I hope my question isn't wrong...
I'm newbie in Gideros (and also, actually, in programming), and... nice to meet you
So, you can do this with usual table (the code is just example):
local texture = Texture.new("chuchuchu.png")
local frame = {}
for i=0, 4 do
frame[i+1] = Bitmap.new(TextureRegion.new(texture, i*100, 0, 100, texture:getHeight()))
end |
Is there a way to assign value to MovieClip table that way?
If I have many charaters and the number of sprite's frame is varying, then I have to assign each frame to MovieClip.
I've tried this:
local mc = MovieClip.new{
{1, duration, frame[1]},
}
for i=2, 10 do
mc[i] = {duration*(i-1)+1, duration*i, frame[i]}
end |
when I printed #mc, it printed 10, but the animation didn't work.
If you have a way, please tell me. And if there's no way to do something like that, please also tell me
Comments
So you can simply generate needed table and pass it to MovieClip constructor
Likes: monkry
Thank you, thank you so much for your help! :'D
Actually, At first I was kinda pessimist seeing your answer, because I've tried something like that (passing table as its param) and it was failed. But I've done the table wrong...
Again, thank you so much for your help!
Likes: ar2rsawseen