I have been working on my own SceneManager class for fun and to learn more about Gideros and Lua. I come from using Obj-C and am used to many of its conventions.
I have a class "SceneManager" and a class "Layer". SceneManager and Layer are derived from a Sprite with Core.class(Sprite) and this works great. The problem is that I want to make a new class using Layer as a base and to override its functions. The problem is that Layer functions are not being overridden and are still being called. I assume this is because I am using events or something. Is there a way to call an eventlistener on the base class Layer and only use the functions in the subclass MenuScene?
Layer = Core.class(Sprite)
self:addEventListener(Event.ADDED_TO_STAGE, self.onAdd, self)
self:addEventListener(Event.ENTER_FRAME, self.onUpdate, self)
self:addEventListener(Event.REMOVED_FROM_STAGE, self.onRemove, self)
self.paused = false
MenuScene = Core.class(Layer)
local background = Bitmap.new(Texture.new("gfx/background.png"))
local OptionsButton = Button.new( Bitmap.new(Texture.new("gfx/button_up.png")) , Bitmap.new(Texture.new("gfx/button_down.png")) )
OptionsButton:addEventListener("click", self.onOptionsButtonClicked, self)
self:removeEventListener(Event.ADDED_TO_STAGE, self.onAdd, self)
--self:removeEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
--Handle Button Functions
scene = PauseScene:new()