Why the code doesn’t work. I need to make sure there is a random background when initializing an object.
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("@render:", "use_fixed_fit_projection")
--math.randomseed(socket.gettime())
self.bg = math.random()
if self.bg > 0.5 then
go.set("bg#sprite", "default_animation", "bg1")
else
go.set("bg#sprite", "default_animation", "bg2")
end
end
Writes that I can access.