This is a generic Widget interface, which is the base class for all other widgets.
Widgets can be queried about their size and can be painted on screen. that's it for now. Probably we need something more elaborate later.
If the table that was given to us as parameter has an "init" method, it will be called. use this to set instance variables rather than class variables.
|Widget:extend (subclass)||Use this method to define a widget subclass that's inherited from a base class widget.|
|Widget:new (o)||Use this method to initiate an instance of a class.|
|Widget:paintTo (bb, x, y)||Paint widget to a BlitBuffer.|
|Widget||Widget base class|
- Widget:extend (subclass)
Use this method to define a widget subclass that's inherited from a base class widget.
It only setups the metatable (or prototype chain) and will not initiate a real instance, i.e. call self:init().
- subclass table
- Widget:new (o)
Use this method to initiate an instance of a class.
Do NOT use it for class definitions because it also calls self:init().
- o table
- Widget:paintTo (bb, x, y)
Paint widget to a BlitBuffer.
- bb BlitBuffer BlitBuffer to paint to. If it's the screen BlitBuffer, then widget will show up on screen refresh.
- x int x offset within the BlitBuffer
- y int y offset within the BlitBuffer