It looks like you're new here. If you want to get involved, click one of these buttons!
--Moneda.lua-- Moneda = Core.class(Sprite) function Moneda:init() self:setX(100) self:setY(100) self:addChild(Bitmap.new(Texture.new("Images/moneda.png"))) end --Estrella.lua-- Estrella = Core.class(Sprite) function Estrella:init() self:setX(100) self:setY(100) self:addChild(Bitmap.new(Texture.new("Images/estrella.png"))) end --Main.lua-- local a="Moneda" local b="Estrella" stage:addChild(a.new()) stage:addChild(b.new()) |
Comments
They are two different objects, and create one or another depending on the value of a variable without using the if statement.
Thank you very much
Likes: vitalitymobile