Skip to content

IRender

jsutlive edited this page May 13, 2023 · 7 revisions

Interface IRender

Introduction

This interface is used for providing a mechanism to provide a rendering of the physics objects to the screen during the render loop. There are two events used for handling render addition to the state object, typically only the render system will need to reference these. For classes that extend the IRender method, it is best to call the add method during object creation (for components, do so in awake()), and to call the remove method during object deletion (for components, do so in onDestroy()).

Events

Accessibility Type Variable Name Description
public IRender onRendererAdded called in the add method, used to add renderer reference to render system
public IRender onRendererRemoved called in the remove method, used to remove renderer reference from the render system

Methods

Note all interface methods are considered to be public

Return Type Method Name Description
void add add this to object pool of render system
void remove remove from object pool of render system
void render paint object to a Graphics object
void drawLine draw a line to the screen given a start point (vector), end point (vector), graphics object, and (optional) color
void drawPolygon draw a polygon to the screen given a list of points(vectors) (in clockwise order), graphics object, and (optional) color
void drawCircle draw a circle to the screen from a given center vector, radius, graphics object, and (optional) color
Clone this wiki locally