Gorgon
Show / Hide Table of Contents

Interface IContentRenderer

Defines a rendering interface for rendering content in content editor plug in views.

Inherited Members
IGorgonNamedObject.Name
IDisposable.Dispose()
Namespace: Gorgon.Editor.Rendering
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IContentRenderer : IGorgonNamedObject, IDisposable
Remarks

See the DefaultContentRenderer<T> class for more information on a base rendering class that developers can inherit in order to implement their own renderer(s).

Properties

| Edit this page View Source

BackgroundColor

Property to set or return the color to use when clearing the swap chain.

Declaration
GorgonColor BackgroundColor { get; set; }
Property Value
Type Description
GorgonColor
Remarks

This value defaults to the background color of the view.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

CanPanHorizontally

Property to set or return whether the content can be horizontally panned.

Declaration
bool CanPanHorizontally { get; set; }
Property Value
Type Description
bool
See Also
DefaultContentRenderer<T>
| Edit this page View Source

CanPanVertically

Property to set or return whether the content can be vertically panned.

Declaration
bool CanPanVertically { get; set; }
Property Value
Type Description
bool
See Also
DefaultContentRenderer<T>
| Edit this page View Source

CanZoom

Property to set or return whether the content can be zoomed.

Declaration
bool CanZoom { get; set; }
Property Value
Type Description
bool
See Also
DefaultContentRenderer<T>
| Edit this page View Source

ClientSize

Property to return the size of the view client area.

Declaration
Size2 ClientSize { get; }
Property Value
Type Description
Size2
See Also
DefaultContentRenderer<T>
| Edit this page View Source

ContentSize

Property to return the size of the content in camera space.

Declaration
Size2F ContentSize { get; }
Property Value
Type Description
Size2F
See Also
DefaultContentRenderer<T>
| Edit this page View Source

IsEnabled

Property to set or return whether the renderer is enabled.

Declaration
bool IsEnabled { get; set; }
Property Value
Type Description
bool
See Also
DefaultContentRenderer<T>
| Edit this page View Source

Offset

Property to return the offset of the image.

Declaration
Vector2 Offset { get; }
Property Value
Type Description
Vector2
See Also
DefaultContentRenderer<T>
| Edit this page View Source

RenderRegion

Property to return the region to render into.

Declaration
RectangleF RenderRegion { get; }
Property Value
Type Description
RectangleF
See Also
DefaultContentRenderer<T>
| Edit this page View Source

Zoom

Property to return the current zoom level.

Declaration
float Zoom { get; }
Property Value
Type Description
float
See Also
DefaultContentRenderer<T>
| Edit this page View Source

ZoomLevel

Property to return the current zoom level.

Declaration
ZoomLevels ZoomLevel { get; }
Property Value
Type Description
ZoomLevels
See Also
DefaultContentRenderer<T>

Methods

| Edit this page View Source

CenterView()

Function to center the view.

Declaration
void CenterView()
See Also
DefaultContentRenderer<T>
| Edit this page View Source

LoadResources()

Function to load resources for the renderer.

Declaration
void LoadResources()
Remarks

This method is used to load any required temporary resources for the renderer prior to rendering content. This must be paired with a call to UnloadResources() when the renderer is no longer in use to ensure efficient memory usage.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

MoveTo(Vector2, float)

Function to move the camera to the offset position, and, optionally, the zoom to the offset.

Declaration
void MoveTo(Vector2 offset, float zoom)
Parameters
Type Name Description
Vector2 offset

The offset to apply to the view, in client space.

float zoom

The amount to zoom, normalized percentage (1 = 100%, 0.5 = 50%, 4 = 400%, etc...).

Remarks

To zoom to the current window size, set the zoom value to less than or equal to 0.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

Render()

Function to render the content.

Declaration
void Render()
Remarks

This method is called by the view to render the content.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

SetOffset(Vector2)

Function to set the offset of the view.

Declaration
void SetOffset(Vector2 offset)
Parameters
Type Name Description
Vector2 offset

The offset to apply to the view, in world space.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

SetZoom(float)

Function to set the zoom on the view.

Declaration
void SetZoom(float zoom)
Parameters
Type Name Description
float zoom

The zoom value to apply.

See Also
DefaultContentRenderer<T>
| Edit this page View Source

UnloadResources()

Function to unload resources from the renderer.

Declaration
void UnloadResources()
Remarks

This method is used to unload temporary resources for the renderer when it is no longer needed. Failure to call this may result in memory leakage.

See Also
DefaultContentRenderer<T>

Events

| Edit this page View Source

OffsetChanged

Event triggered when the camera is moved.

Declaration
event EventHandler<OffsetEventArgs> OffsetChanged
Event Type
Type Description
EventHandler<OffsetEventArgs>
See Also
DefaultContentRenderer<T>
| Edit this page View Source

RenderRegionChanged

Event triggered when the render region has changed its size.

Declaration
event EventHandler RenderRegionChanged
Event Type
Type Description
EventHandler
See Also
DefaultContentRenderer<T>
| Edit this page View Source

ZoomScaleChanged

Event triggered when the camera is zoomed.

Declaration
event EventHandler<ZoomScaleEventArgs> ZoomScaleChanged
Event Type
Type Description
EventHandler<ZoomScaleEventArgs>
See Also
DefaultContentRenderer<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

DefaultContentRenderer<T>
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author