change class instantiation implementation

This commit is contained in:
Hersi 2022-04-27 02:49:04 +02:00
parent 5598431951
commit 98544e5e8a
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ function Animation.new(animPath, params)
if (params.alpha ~= nil) then instance.alpha = params.alpha; end
if (params.stroke ~= nil) then instance.stroke = params.stroke; end
return Base(Animation, instance);
return CreateInstance(Animation, instance);
end
---Create an AnimationState to play this animation.
@ -119,7 +119,7 @@ end
function Animation:createState(callback)
---@type AnimationState
local state = { animation = self, callback = callback, frameIndex = 1, timer = 0, running = false };
return Base(AnimationState, state);
return CreateInstance(AnimationState, state);
end
---Create an AnimationState to play this animation and start it.

View File

@ -58,7 +58,7 @@ function Image.new(imagePath, noFallback)
height = height,
};
return Base(Image, instance);
return CreateInstance(Image, instance);
end
---Set the width and height of this Image.