add texture func
This commit is contained in:
parent
44bf4528df
commit
f4e8c1df7c
18
main.xml
18
main.xml
|
@ -607,6 +607,24 @@
|
|||
return actor
|
||||
end
|
||||
|
||||
function Texture(file)
|
||||
if actorsInitializing then error('uranium: cannot create an actor during actor initialization!!', 2) end
|
||||
if actorsInitialized then error('uranium: cannot create an actor during runtime!!', 2) end
|
||||
if not file then error('uranium: cannot create a texture without a file', 2) end
|
||||
local actor = createProxyActor('RageTexture')
|
||||
|
||||
table.insert(actorQueue, {
|
||||
type = 'Sprite',
|
||||
file = file and oat.dir .. file,
|
||||
init = function(a)
|
||||
a:hidden(1)
|
||||
actor.__lock(a:GetTexture())
|
||||
end
|
||||
})
|
||||
actor.__queueRepresentation(actorQueue[#actorQueue])
|
||||
return actor
|
||||
end
|
||||
|
||||
function Model(file)
|
||||
if actorsInitializing then error('uranium: cannot create an actor during actor initialization!!', 2) end
|
||||
if actorsInitialized then error('uranium: cannot create an actor during runtime!!', 2) end
|
||||
|
|
|
@ -30,6 +30,10 @@ function Polygon() end
|
|||
--- Defines a Sprite actor.
|
||||
function Sprite(file) end
|
||||
---@param file string
|
||||
---@return RageTexture
|
||||
--- Defines a texture.
|
||||
function Texture(file) end
|
||||
---@param file string
|
||||
---@return Model
|
||||
--- Defines a Model actor.
|
||||
function Model(file) end
|
||||
|
|
Loading…
Reference in New Issue