DrawTexture: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
{{FuncReturnValue|__EDIT_ME__}} | {{FuncReturnValue|__EDIT_ME__}} | ||
== Example == | |||
<syntaxhighlight lang="Lua"> | |||
local tex | |||
local tex2 | |||
== | function OnPackageStart() | ||
tex = UTexture2D.LoadFromAsset("/Game/Weapons/Images/T_Pistol01") | |||
tex2 = UTexture2D.LoadFromFile("freeroam/usa.png") | |||
end | |||
AddEvent("OnPackageStart", OnPackageStart) | |||
AddEvent("OnRenderHUD", function() | |||
DrawTexture(tex, 110, 110, 0.2, false) | |||
DrawTexture(tex2, 140, 140, 0.1, false) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} |
Revision as of 09:30, 11 April 2020
Description
Draw an UTexture on screen. https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/AHUD/DrawTexture/index.html
Syntax
DrawTexture(UTexture TextureReference, ScreenX, SCreenY, Scale, bScalePosition)
Parameters
- TextureReference
Texture reference from LoadFromAsset or LoadFromFile.
Return Value
- __EDIT_ME__
Example
local tex
local tex2
function OnPackageStart()
tex = UTexture2D.LoadFromAsset("/Game/Weapons/Images/T_Pistol01")
tex2 = UTexture2D.LoadFromFile("freeroam/usa.png")
end
AddEvent("OnPackageStart", OnPackageStart)
AddEvent("OnRenderHUD", function()
DrawTexture(tex, 110, 110, 0.2, false)
DrawTexture(tex2, 140, 140, 0.1, false)
end)