Results 1 to 7 of 7

Thread: Cursor

  
  1. #1
    splodger15 is offline -Hacks Newbie
    Join Date
    Aug 2006
    Posts
    39
    Rep Power
    14

    Default

    What i would like help with was could i have a cursor (arrow) and it can move on the screen and select what you wanted it to select


    Thanks Splodger15

    Join my PSP site here: http://splodger15.forum5.com/

  2. #2
    ST@TIC is offline -Hacks Newbie
    Join Date
    Nov 2006
    Location
    South Africa
    Posts
    39
    Rep Power
    14

    Default

    ok well first i surgest u get a curser image then u can just blit to to the pos of the x and y values

    then u are going to have to do a colision detection with a pad:cross() cheak as well:

    --btn is the button

    collided = false

    if (x > btn.x) and (x< btn.x+width) and (y > btn.y) and (y < btn.y+height ) and(pad:cross()) then

    --your code here

    end

    think thats right :)

    \"Death be not proud, some have called thee mighty and great, thou art not so\"

  3. #3
    splodger15 is offline -Hacks Newbie
    Join Date
    Aug 2006
    Posts
    39
    Rep Power
    14

    Default

    Would it be something like this

    collided = false

    if (x > cross.x) and (x< cross.x+width) and (y > cross.y) and (y < cross.y+height ) and(pad:cross()) then

    --your code here

    end

    Would this let me select something on the screem
    Join my PSP site here: http://splodger15.forum5.com/

  4. #4
    ST@TIC is offline -Hacks Newbie
    Join Date
    Nov 2006
    Location
    South Africa
    Posts
    39
    Rep Power
    14

    Default

    ya that should work

    o sorry u can take the collided = false part out it was some thing i changed

    try and see if it does what u want

    ps What are you making

    \"Death be not proud, some have called thee mighty and great, thou art not so\"

  5. #5
    splodger15 is offline -Hacks Newbie
    Join Date
    Aug 2006
    Posts
    39
    Rep Power
    14

    Default

    Would all of it be

    Image.load("images/cursor.PNG")
    screen:blit(0, 0, cursor)

    if (x > cross.x) and (x< cross.x+width) and (y > cross.y) and (y < cross.y+height ) and(pad:cross()) then

    --Code here

    end

    Is that right or wrong
    Join my PSP site here: http://splodger15.forum5.com/

  6. #6
    ST@TIC is offline -Hacks Newbie
    Join Date
    Nov 2006
    Location
    South Africa
    Posts
    39
    Rep Power
    14

    Default

    Image.load("images/cursor.PNG")
    screen:blit(x, y, cursor) --x and y is affected by controls(how u move it around)
    -- cross is going to be the thing u are going to select (a button i guess) and height and width is going to be the buttons height and width

    if (x > cross.x) and (x< cross.x+width) and (y > cross.y) and (y < cross.y+height ) and(pad:cross()) then

    --Code here

    end

    \"Death be not proud, some have called thee mighty and great, thou art not so\"

  7. #7
    splodger15 is offline -Hacks Newbie
    Join Date
    Aug 2006
    Posts
    39
    Rep Power
    14

    Default

    ahhh yes i understand now

    Thanks for the help
    Join my PSP site here: http://splodger15.forum5.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •