--save new method as some other method |
--extend new class from Bitmap |
do |
Sprite.__new = Sprite.new |
do |
Sprite.coordinate = { --extend class by a table |
jack0088 said:But then Sprite doesn't propagate this value to it's instances.. at least I thought so?!
jack0088 said:PS: If I extend the Sprite class with this table, WHY the Shape class doesn't has it too, when a call Shape.new()?
ar2rsawseen said:Because Shape class extends Sprite class somewhere internally, much before you modify Sprite class
function implementAnchorpoint(anyClass) |
Loves: techdojo
local function AnchorPoint( Class ) |
local rect = Primitive.new() --equivalent to Shape.new() |
local __setX = Class.setX |
print("#", self:getX(), self:getY()) --returns (0,0)! |
print("R",rect:getPosition()) --returns (-59,0)??? |


local dx = self:getAnchorPointOffsetX() |
Loves: chipster123, jack0088
Loves: chipster123
It looks like you're new here. If you want to get involved, click one of these buttons!
ar2rsawseen
2514
OZApps
1255
techdojo
1228