Hello. I have another question.
Then in my instancied objects, I have Sprites.
I can’t find the mean to make one of the sprite animated, with that function :
go.animate(".", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/self.speed)
Work well. But it makes everything in the object rotate with it.
I can’t find a way to make only the sprite rotate (with the other sprite not rotating). Is it even possible ?
Apparently, components in the object don’t have any property (not even “rotation”, “url” or “id” :
[main:/instance0#sprite]' does not have any property called 'euler.z'
What I want to do :
My instancied object create a star. Complete with collision box, sprites and script.
In the INIT() of the script, I animate the object (with go.animate), give some poperties to the sprite (with msg.post), and put datas about the new star in a global table (with lua_ecrire_systeme, a function in a lua) :
-- Create rotation of star
local vitesse = math.random(1, 10)
self.speed = vitesse
go.animate(".", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/self.speed)
-- go.animate("#sprite", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/self.speed) => [main:/instance0#sprite]' does not have any property called 'euler.z'
-- Set colour of star
local couleur = math.random(1,7)
lua_ecrire_systeme(self.id, "couleur", liste_etoiles[couleur])
couleur1 = "E_"..liste_etoiles[couleur]
msg.post("#sprite", "play_animation", {id = hash(couleur1)})
-- Put the close sprite for Stars in invisible (transparency = 0)
sprite.set_constant("#sprite_close", "tint", vmath.vector4(1, 1, 1, 0))
couleur2 = "etoile_"..liste_etoiles[couleur]
msg.post("#sprite_close", "play_animation", {id = hash(couleur2)})
*and so for a some lines*
The stars apprear, populate the screen with various colours, and rotate with at various speed.
I want now put a label under each star. A label THAT DON’T ROTATE. That’s my problem : since I can’t give a component the order to rotate alone, everything rotate.