I need some pointers on making an on screen joystick [RESOLVED]

Hi,
You probably know me as the most anoying person on here.
I have been trying for 2 weeks to google research and program an on screen virtual joystick.
I have found nothing…
If you could give me any pointers that would be great!
Yours truly
TheRogueBatcher

@TheRogueBatcher anytime. I didn’t write it, I just found it and made it more accessible.

Thanks. I was on windows 7. Now here on ipad2 the long press works great.

Actually short pressing works too. : – )

@TheRogueBatcher You’re not the most annoying person on here…

I hope SkyUI will have a built-in joystick (with multiple styles). For now though, the others have some good examples.

@Dwight Welcome to the Codea Forums! That’s a Codea Community project, you long press that little broken image icon, select copy, then go back to your Codea, long press new project, select paste into project, and choose a name. Press done and it’s installed.

Thanks guys you did more work than I asked for WOW

Ps a special thanks to whoever made the joystick example

I plugged joystick into the search box.

http://twolivesleft.com/Codea/Talk/discussion/136/video-game-controllers

I’m creating a project with the examples for you.

@TheRogueBatcher Not sure if this is what you’re after. Just touch the screen and move in any direction.


displayMode(FULLSCREEN)

function setup()
    js={}
    cx=400
    cy=200
    x,y=0,0
end

function draw()
    background(40, 40, 50)
    fill(255)
    sprite("Planet Cute:Character Boy",cx,cy)
    if x + y>0 then
        cx=cx+(tx-x)/10
        cy=cy+(ty-y)/10
        fill(255)
        ellipse(x,y,8)    -- draw circle center
        noFill()
        stroke(255)
        strokeWidth(4)
        ellipse(x,y,200)    -- draw outer circle
    end
end

function touched(t)
    if t.state==BEGAN then    -- starting center point
        x=t.x
        y=t.y
        tx=x
        ty=y
    elseif t.state==MOVING then
        tx=t.x
        ty=t.y
    elseif  t.state==ENDED then    -- done moving
        x,y=0,0
    end
end

By @Nat

http://twolivesleft.com/Codea/CC/alpha/index.php?v=1158

Good Afternoon -
Please forgive my noobness. When I go to that link:
http://twolivesleft.com/Codea/CC/alpha/index.php?v=1158

I get an air-code like project. But I am unable to look at the other tabs. I can only see the first tab.

@Dwight are you on an ipad1? Try long pressing the icon next to where it says touch and longpress the icon. Click copy and paste into a new project.

Well thanks anyway for the effort

There is an old class out here called controllers. Confusing but effective. Used it in Cofender code.

This thread has been dormant for over a month. Please do not resurrect it and thank you
Aciolino

@TheRogueBatcher Given that that month included a holiday period for most people, it’s not surprising that someone’s been away from the forums for a while and is just catching up. Moreover, the time stamps just say “December 2013” which could actually have been just over a week ago. So it isn’t unreasonable that aciolino thought this still an open thread and just wanted to point out something that might help.

We don’t like very old threads being bumped because the usual reason is someone posting a new question that doesn’t make sense without reading the old discussion and in all likelihood everyone involved has forgotten it. But I think that the grace period is a little longer than you’ve allowed for here.

In addition, I would make the politeness message about resurrecting old threads time-dependent. Yours is a little abrupt, and I would only use that on threads of the order of a year or more without activity. For this, I would prefer something like “Thanks for your suggestion, I’m no longer interested in this thread but I’ll bear it in mind if ever I need to come back to it.” and then maybe change the title so that it has the word “closed” or “solved” or “resolved” in it.

Anyway lets not talk on this thread anymore so that it sinks away