Jump to content

Lua Help - Buttons

- - - - -

  • Please log in to reply
No replies to this topic

#1
mkjt88

mkjt88

    Newbie

  • Members
  • PipPip
  • 27 posts
Hey I'm just trying to do things with lua to learn and was gonna just make a little program that displays parts of images I have created with a next and previous button.. sorta like a little slideshow. Now what I have right now is one image in there with a button and text over it saying next. I need to know a way to make the "Next" a button to the next image and a way to get back to the previous one. Is there a simple way or can anyone give me suggestions on what functions or things I should be using to make this happen. Thanks.

Attached File  prev.jpg   97.52K   20 downloads

local neb = display.newImage( "neb.jpg" )
neb.x = display.contentWidth / 2
neb.y = display.contentHeight - 220

local titleObject = display.newText( "Incendiary Nebula", 40, 50, nil, 20 )
    titleObject:setTextColor( 255,255,255 )
    
local buttonObject = display.newImage( "White_Button.png", 235, 20, nil, 20 )

local nextText = display.newText ( "Next", 255, 30, nil, 16 )
    nextText:setTextColor( 255,255,255 )
    
--[local prevText = display.newText ( "Previous", 15, 30, nil, 16 )
    --[prevText:setTextColor( 255,255,255 )

transition.to( titleObject, { time=450, y=titleObject.y+400, x=titleObject.x+32 } )







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users