How to change image

How do make when i touch, change existing image to different image?i have 20 image in one scene.Thanks

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You will need to use the Chanfe Image behavior.

    When touch us pressed:
    --change image to (click the drop down menu and select your image)
    ---end rule
  • wolala123wolala123 Member Posts: 249
    @Braydon_SFX thx first,but i want press one image change to 1st image till 4th image and recycle it..
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Use an actor attribute to represent a number 1 through 4.
    When touch is pressed, Change Attribute:
    ---self.Counter = mod(self.Counter,4)+1
    ---Change Attribute: self.Image = [something based on the self.Counter]

    now that [something based on the self.Counter] could be the value from a table using the Counter as the row value, or if you name all your images with the same pattern (image1, image2,image3,image4) you could make it "image"..self.Counter
  • wolala123wolala123 Member Posts: 249
    edited June 2013
    @CodeMonkey..What if i have 3 same actor in the scene, i touch one of the actor to change image but other two actor i want remain current image?i use above method or else?.thx
  • SocksSocks London, UK.Member Posts: 12,822
    @CodeMonkey

    Re: mod v %

    With all the rearranging of various plans, and the whole Lua-drop™ vs Lets–make-Lua-scary-fast™ thing, is the plan still to move from '%' to 'mod' . . . . and should we be adapting it now ?
Sign In or Register to comment.