Interface IContentRenderer
Defines a rendering interface for rendering content in content editor plug in views.
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 SourceBackgroundColor
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
| Edit this page View SourceCanPanHorizontally
Property to set or return whether the content can be horizontally panned.
Declaration
bool CanPanHorizontally { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceCanPanVertically
Property to set or return whether the content can be vertically panned.
Declaration
bool CanPanVertically { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceCanZoom
Property to set or return whether the content can be zoomed.
Declaration
bool CanZoom { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceClientSize
Property to return the size of the view client area.
Declaration
Size2 ClientSize { get; }
Property Value
Type | Description |
---|---|
Size2 |
See Also
| Edit this page View SourceContentSize
Property to return the size of the content in camera space.
Declaration
Size2F ContentSize { get; }
Property Value
Type | Description |
---|---|
Size2F |
See Also
| Edit this page View SourceIsEnabled
Property to set or return whether the renderer is enabled.
Declaration
bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceOffset
Property to return the offset of the image.
Declaration
Vector2 Offset { get; }
Property Value
Type | Description |
---|---|
Vector2 |
See Also
| Edit this page View SourceRenderRegion
Property to return the region to render into.
Declaration
RectangleF RenderRegion { get; }
Property Value
Type | Description |
---|---|
RectangleF |
See Also
| Edit this page View SourceZoom
Property to return the current zoom level.
Declaration
float Zoom { get; }
Property Value
Type | Description |
---|---|
float |
See Also
| Edit this page View SourceZoomLevel
Property to return the current zoom level.
Declaration
ZoomLevels ZoomLevel { get; }
Property Value
Type | Description |
---|---|
ZoomLevels |
See Also
Methods
| Edit this page View SourceCenterView()
Function to center the view.
Declaration
void CenterView()
See Also
| Edit this page View SourceLoadResources()
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
| Edit this page View SourceMoveTo(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
| Edit this page View SourceRender()
Function to render the content.
Declaration
void Render()
Remarks
This method is called by the view to render the content.
See Also
| Edit this page View SourceSetOffset(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
| Edit this page View SourceSetZoom(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
| Edit this page View SourceUnloadResources()
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
Events
| Edit this page View SourceOffsetChanged
Event triggered when the camera is moved.
Declaration
event EventHandler<OffsetEventArgs> OffsetChanged
Event Type
Type | Description |
---|---|
EventHandler<OffsetEventArgs> |
See Also
| Edit this page View SourceRenderRegionChanged
Event triggered when the render region has changed its size.
Declaration
event EventHandler RenderRegionChanged
Event Type
Type | Description |
---|---|
EventHandler |
See Also
| Edit this page View SourceZoomScaleChanged
Event triggered when the camera is zoomed.
Declaration
event EventHandler<ZoomScaleEventArgs> ZoomScaleChanged
Event Type
Type | Description |
---|---|
EventHandler<ZoomScaleEventArgs> |