Class RenderManager
Manager for rendering Sprites of GameObjects
Inheritance
System.Object
RenderManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public class RenderManager : IManager
Fields
| Improve this Doc View SourceIsometricRotation
Rotation of the prefab that will result in an isometric view
Declaration
public static readonly Quaternion IsometricRotation
Field Value
| Type | Description |
|---|---|
| Quaternion |
Properties
| Improve this Doc View SourceInstance
Singleton instance
Declaration
public static RenderManager Instance { get; }
Property Value
| Type | Description |
|---|---|
| RenderManager |
Methods
| Improve this Doc View SourceEnqueueRender(GameObject, Action<Sprite>)
Create a of the
target
Declaration
[Obsolete("Use Render instead")]
public bool EnqueueRender(GameObject target, Action<Sprite> callback)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | target | GameObject to render |
| System.Action<Sprite> | callback | Callback for the generated |
Returns
| Type | Description |
|---|---|
| System.Boolean | If this is called on a headless server or when there is no active visual Mesh attached to the target, this method invokes the callback with null immediately and returns false. |
EnqueueRender(GameObject, Action<Sprite>, Int32, Int32)
Queues a new prefab to be rendered. The resulting will be ready at the next frame.
If there is no active visual Mesh attached to the target, this method invokes the callback with null immediately.
Declaration
[Obsolete("Use Render instead")]
public bool EnqueueRender(GameObject target, Action<Sprite> callback, int width = 128, int height = 128)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | target | Object to be rendered. A copy of the provided GameObject will be created for rendering |
| System.Action<Sprite> | callback | Action that gets called when the rendering is complete |
| System.Int32 | width | Width of the resulting |
| System.Int32 | height | Height of the resulting |
Returns
| Type | Description |
|---|---|
| System.Boolean | Only true if the target was queued for rendering |
EnqueueRender(RenderManager.RenderRequest, Action<Sprite>)
Enqueue a render of the RenderManager.RenderRequest
Declaration
[Obsolete("Use Render instead")]
public bool EnqueueRender(RenderManager.RenderRequest renderRequest, Action<Sprite> callback)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderManager.RenderRequest | renderRequest | |
| System.Action<Sprite> | callback | Callback for the generated |
Returns
| Type | Description |
|---|---|
| System.Boolean | If this is called on a headless server or when there is no active visual Mesh attached to the target, this method invokes the callback with null immediately and returns false. |
Init()
Initialize the manager
Declaration
public void Init()
Render(GameObject)
Create a of the
target
Declaration
public Sprite Render(GameObject target)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | target | Can be a prefab or any existing GameObject in the world |
Returns
| Type | Description |
|---|---|
| Sprite | If this is called on a headless server or when there is no active visual Mesh attached to the target, this method returns null. |
Render(GameObject, Quaternion)
Create a of the
target
Declaration
public Sprite Render(GameObject target, Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | target | Can be a prefab or any existing GameObject in the world |
| Quaternion | rotation | Rotation while rendering of the GameObject. See for example/> |
Returns
| Type | Description |
|---|---|
| Sprite | If this is called on a headless server or when there is no active visual Mesh attached to the target, this method returns null. |
Render(RenderManager.RenderRequest)
Create a from a RenderManager.RenderRequest/>
Declaration
public Sprite Render(RenderManager.RenderRequest renderRequest)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderManager.RenderRequest | renderRequest |
Returns
| Type | Description |
|---|---|
| Sprite | If this is called on a headless server or when there is no active visual Mesh attached to the target, this method returns null. |