EPOK RUNTIME
epok::Camera2DComponent
Class
Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.
Class
---- Camera2D -------------------------------------------------------------------------- Follows its owner's world position.
Basic usage
This generated sketch illustrates syntax for reaching the type; adapt it to the actual API contract. Open a member below for an operation-specific example.
C++ example
#include "world2d_components.hpp"
epok::Camera2DComponent& value = /* obtain a valid instance from your game */;Fields and constants
backgroundClear colour used when no 3D camera paints the background.FieldcurrentExposes `current` on `epok::Camera2DComponent` for the world2d components module.Fielddrag_enabledExposes `drag_enabled` on `epok::Camera2DComponent` for the world2d components module.Fielddrag_marginsLeft, top, right, bottom fractions (0..1) of the half view the target may move freely.FieldinitializedExposes `initialized` on `epok::Camera2DComponent` for the world2d components module.FieldlimitsLeft, top, right, bottom world pixels the view must stay inside.Fieldlimits_enabledExposes `limits_enabled` on `epok::Camera2DComponent` for the world2d components module.Fieldlink2dExposes `link2d` on `epok::Camera2DComponent` for the world2d components module.FieldoffsetExposes `offset` on `epok::Camera2DComponent` for the world2d components module.FieldpositionResolved state, owned by the service.FieldrotatingExposes `rotating` on `epok::Camera2DComponent` for the world2d components module.FieldrotationExposes `rotation` on `epok::Camera2DComponent` for the world2d components module.Fieldshake_amplitudeExposes `shake_amplitude` on `epok::Camera2DComponent` for the world2d components module.Fieldshake_durationExposes `shake_duration` on `epok::Camera2DComponent` for the world2d components module.Fieldshake_seedExposes `shake_seed` on `epok::Camera2DComponent` for the world2d components module.Fieldshake_timeExposes `shake_time` on `epok::Camera2DComponent` for the world2d components module.FieldsmoothingExposes `smoothing` on `epok::Camera2DComponent` for the world2d components module.Fieldsmoothing_speedExposes `smoothing_speed` on `epok::Camera2DComponent` for the world2d components module.Fieldstatic_class_idExposes `static_class_id` on `epok::Camera2DComponent` for the world2d components module.VariablezoomExposes `zoom` on `epok::Camera2DComponent` for the world2d components module.FieldPublic methods
~Camera2DComponentReleases the resources owned by `epok::Camera2DComponent`.destructorclass_idPerforms `class id` as part of the world2d components module.Methodclear_limitsClears limits as part of the world2d components module.MethodfollowOne simulation step towards `target` (the owner's world position).Methodget_zoomReturns zoom as part of the world2d components module.Methodis_currentReports whether current as part of the world2d components module.Methodlevel_attachedPerforms `level attached` as part of the world2d components module.Methodmake_currentPerforms `make current` as part of the world2d components module.Methodreset_smoothingJump to the target this step instead of smoothing towards it.Methodscreen_center_xPerforms `screen center x` as part of the world2d components module.Methodscreen_center_yPerforms `screen center y` as part of the world2d components module.Methodset_limitsSets limits as part of the world2d components module.Methodset_offsetSets offset as part of the world2d components module.Methodset_zoomSets zoom as part of the world2d components module.MethodshakeShakes the view by up to `amplitude` pixels, fading out over `seconds`.MethodviewThe Camera2D the renderer projects through.Method