Always snap to grid
UE2:Create a ScriptedTexture
You can create the ScriptedTexture(U2, U2XMP, UE2Runtime, UT2003, UT2004) either statically with UnrealEd 3 or dynamically in UnrealScript.
In UnrealEd[edit]
Use this method if you need a texture e.g. for a CameraTextureClient(U2, UE2Runtime, UT2003, UT2004).
This is a page about a basic procedure related to the Unreal Editor. You are encouraged to link this page from other pages instead of explaining the procedure there. |
- Open the Texture Browser.
- Select File -> New... from the browser's menu.
- Specify a target package and texture name, optionally also a group name.
- Use the factory class "Raw Material".
- Set the MaterialClass in the factory properties to ScriptedTexture (class'Engine.ScriptedTexture').
- Click New.
- The ScriptedTexture properties window should open automatically. Set the desired dimensions via UClamp and VClamp there.
As usual, unless you put it in myLevel, you need to save the package.
In UnrealScript[edit]
This is a page about a basic procedure related to UnrealScript. You are encouraged to link this page from other pages instead of explaining the procedure there. |
A ScriptedTexture can be created with the following code snippet:
local ScriptedTexture ST; ST = new class'ScriptedTexture'; ST.SetSize(SizeX, SizeY); ST.Client = someActor;
This creates a new ScriptedTexture that is SizeX pixels wide and SizeY high that is rendered through the RenderTexture() event of someActor.
Note that this example may waste resources if the ScriptedTexture will only be used for a limited duration. The UT2004 Hellbender (Onslaught.ONSPRV) provides a more efficient example for this case, using the global ObjectPool(U2, U2XMP, UE2Runtime, UT2003, UT2004) to allocate and release the ScriptedTexture used for the license plate.