|
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
|
The scene view's current render context, for gizmo code to read: More...
#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/SceneView.h>
Public Member Functions | |
| void | BeginObject (const SceneViewContext &ctx) |
| Sets the context for one object's gizmos, from ctx. | |
| void | ClaimMouse () |
| A gizmo calls this every frame the pointer is on one of its handles, or a handle is being dragged: a click then goes to the handle instead of selecting or moving an object. | |
| void | ClearMouseClaim () |
| void | DrawCircle (float cx, float cy, float radius, uint32_t rgba, float thickness=1.0f) |
| void | DrawCircleFilled (float cx, float cy, float radius, uint32_t rgba) |
| void | DrawLine (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f) |
| void | DrawRect (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f, float rounding=0.0f) |
| void | DrawRectFilled (float x0, float y0, float x1, float y1, uint32_t rgba, float rounding=0.0f) |
| void | EndObject () |
| Deki::Object * | GetCurrentObject () const |
| float | GetDisplayHeight () const |
| float | GetDisplayWidth () const |
| Display size for the current component. | |
| float | GetPixelsPerMeter () const |
| Pixels per meter of the scene view: the project's art density. | |
| Deki::ColorFormat | GetPreviewFormat () const |
| Pixel format of the previewed screen; play mode renders in it. | |
| int | GetPreviewHeight () const |
| Height in pixels of the previewed screen (see GetPreviewWidth). | |
| int | GetPreviewWidth () const |
| Width in pixels of the screen the Play view previews: the resolution picked in its toolbar, or for an aspect ratio, the panel's size at that ratio. | |
| float | GetRotation () const |
| Rotation in radians, engine convention. | |
| float | GetScaleX () const |
| World scale. | |
| float | GetScaleY () const |
| float | GetScreenX () const |
| Screen position of the object's centre. | |
| float | GetScreenY () const |
| float | GetWorldToScreenScale () const |
| World meters to screen pixels (zoom * pixelsPerMeter). | |
| float | GetWorldX () const |
| float | GetWorldY () const |
| float | GetZoom () const |
| View zoom: editor wheel zoom * dpi, without pixels-per-meter. | |
| bool | IsCurrentObjectSelected () const |
| bool | IsMouseClaimed () const |
| bool | IsPointerOnCanvas () const |
| Whether the pointer is over the scene canvas and free to act on it. | |
| void | SetPointerOnCanvas (bool onCanvas) |
| void | SetPreviewFormat (Deki::ColorFormat format) |
| void | SetPreviewSize (int width, int height) |
| Previews a screen of this size. The Play view calls it every frame. | |
Static Public Member Functions | |
| static SceneView & | Get () |
| static uint32_t | Rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| Packs an RGBA colour (components 0-255) for the Draw* methods. | |
The scene view's current render context, for gizmo code to read:
auto& view = SceneView::Get(); float halfW = sprite->width * view.GetScaleX() * view.GetZoom() * 0.5f;
SceneViewPanel calls BeginObject/EndObject around each object's gizmos. The scene itself is drawn by DekiRenderSystem.
| void DekiEditor::SceneView::BeginObject | ( | const SceneViewContext & | ctx | ) |
Sets the context for one object's gizmos, from ctx.
|
inline |
A gizmo calls this every frame the pointer is on one of its handles, or a handle is being dragged: a click then goes to the handle instead of selecting or moving an object.
|
inline |
| void DekiEditor::SceneView::DrawCircle | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f ) |
| void DekiEditor::SceneView::DrawCircleFilled | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| uint32_t | rgba ) |
| void DekiEditor::SceneView::DrawLine | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f ) |
| void DekiEditor::SceneView::DrawRect | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | thickness = 1.0f, | ||
| float | rounding = 0.0f ) |
| void DekiEditor::SceneView::DrawRectFilled | ( | float | x0, |
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| uint32_t | rgba, | ||
| float | rounding = 0.0f ) |
| void DekiEditor::SceneView::EndObject | ( | ) |
|
static |
|
inline |
|
inline |
|
inline |
Display size for the current component.
|
inline |
Pixels per meter of the scene view: the project's art density.
|
inline |
Pixel format of the previewed screen; play mode renders in it.
|
inline |
Height in pixels of the previewed screen (see GetPreviewWidth).
|
inline |
Width in pixels of the screen the Play view previews: the resolution picked in its toolbar, or for an aspect ratio, the panel's size at that ratio.
Play mode runs at it, and gizmos use it to show what that screen sees. 320 until the Play view has set it.
|
inline |
Rotation in radians, engine convention.
|
inline |
World scale.
|
inline |
|
inline |
Screen position of the object's centre.
|
inline |
|
inline |
World meters to screen pixels (zoom * pixelsPerMeter).
Use it for any gizmo size given in world units (the camera's visible area, an emission shape's radius). For accents of fixed screen size (crosshairs, handle dots) use GetZoom().
|
inline |
|
inline |
|
inline |
View zoom: editor wheel zoom * dpi, without pixels-per-meter.
|
inline |
|
inline |
|
inline |
Whether the pointer is over the scene canvas and free to act on it.
A gizmo checks this before reacting to the mouse.
|
inlinestatic |
Packs an RGBA colour (components 0-255) for the Draw* methods.
|
inline |
|
inline |
|
inline |
Previews a screen of this size. The Play view calls it every frame.