How to render 2D Images
This article explains how to render 2D images using the Untold Engine
Rendering a 2D image
To render a 2D image, you first instantiate a U4DEngine::U4DImage object as shown in line 1.
Note: Please make sure to read the Untold Engine Toolchain before continuing on with this tutorial. All images must be converted to binary format (.u4d) using the Digital Asset Converter.
Next, provide the name of the image you want to render and the desired dimension for the image (line 2). In this case, I want to render an image called "spaceinvader.png".
The image object is then added to the scenegraph (line 3).
Finally, the image is translated 0.5 units up and to the left (line 4). Recall that the coordinate system for 2D objects is different than for 3D objects. For 2D objects, the coordinate system ranges between [-1.0,1.0].
Here is an example of the result:
Tips
To properly render an image, the 2D image needs to be flipped vertically as shown below. In this instance, I use Gimp to flip the .png file vertically.
Last updated