stdlib.aft: aftSetup for convenience

This commit is contained in:
Jill 2023-05-04 21:56:26 +03:00
parent b34c18da8a
commit 6a0cb734db
Signed by: oat
GPG Key ID: 33489AA58A955108
2 changed files with 15 additions and 4 deletions

View File

@ -17,4 +17,15 @@ function self.aft(self)
self:Create()
end
function self.aftSetup()
local a = ActorFrameTexture()
local b = Sprite()
uranium.on('init', function()
self.aft(a)
self.sprite(b)
b:SetTexture(a:GetTexture())
end)
return a, b
end
return self

View File

@ -348,17 +348,17 @@ local function createGenericFunc(type)
end
end
---@return Quad
--- Defines a Quad actor.
---@type fun(): Quad
Quad = createGenericFunc('Quad')
---@return ActorProxy
--- Defines an ActorProxy actor.
---@type fun(): ActorProxy
ActorProxy = createGenericFunc('ActorProxy')
---@return Polygon
--- Defines a Polygon actor.
---@type fun(): Polygon
Polygon = createGenericFunc('Polygon')
---@return ActorFrameTexture
--- Defines an ActorFrameTexture actor.
---@type fun(): ActorFrameTexture
ActorFrameTexture = createGenericFunc('ActorFrameTexture')
---@param file string | nil