Hi
I have spent 30-60min every evening the last couple of days playing with Gideros, reading and watching videos and starting to get the idea of things. I have almost finished coding my app... well finished it in my head. Now I just need to write the code.
First baby step I want to play with and understand is getting a random picture, and I was hoping for help in connecting the dots.
The real question is: How do I use the random number to get the image??This is my code so far. I have also pasted the "--" code so you maybe can see what I was thinking.
--local img = Bitmap.new(Texture.new("pen1.png"))
local halfposition = application:getDeviceWidth() / 2
local img = {"pen1.png", "pen2.png", "pen3.png" }
local r = math.random(1, #img)
--stage:addChild(Bitmap.new(Texture.new(img)))
--img:setAnchorPoint(0.5, 0)
--img:setPosition(halfposition , 0)
--img:setScale(0.25 , 0.25)
print (r) |
*note: I will use the r-number for something later.
**I could add as many as 150 images.
*** I do know that the "img" in Texture.new(img) dosn't work. I was trying and hoping it might...
Comments
Likes: Den_er_da_hvid
Likes: Den_er_da_hvid
http://giderosmobile.com/forum/discussion/comment/32537#Comment_32537
to read all textures from a texturepack instead of adding them all by hand
Likes: Den_er_da_hvid
I have a trip to norway the few days so I will try it on monday!
@pie Looks like a solution I need to play with. I ties well into solving the next problem. Adding text underneath the image and keeping al the text so it is easy to work width.