Epok Engine

EPOK RUNTIME

World2D Content

world2d_content.hpp · the world2d content module

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.

Module

the world2d content module.

Header
world2d_content.hpp
Include
#include "world2d_content.hpp"
Stability
Epok runtime API

Include this module

C++ include
#include "world2d_content.hpp"

Types

AudioPlayer2DComponent---- AudioPlayer2D ------------------------------------------------------------------------ Plays a clip whose loudness and stereo position follow the current camera: full volume at the centre of the view, fading to silence at `max_distance` pixels, panned by how far left or right of the view's centre it is.ClassEmissionShape2D---- Particles2D -------------------------------------------------------------------------- A CPU particle emitter: `amount` particles live for `lifetime` seconds, spawned evenly (explosiveness 0) or all at once (1) from a point, rectangle or circle, launched in `direction` (degrees, 0 = right, 90 = down) within `spread` at a random speed between `speed[0]` and `speed[1]`, pulled by `gravity`, slowed by `damping`, scaled and tinted from start to end.EnumLine2DComponentClass declared by the world2d-content module for the world2d content module.ClassParticles2DComponentClass declared by the world2d-content module for the world2d content module.ClassPath2DComponent---- Path2D ------------------------------------------------------------------------------- A polyline (curves are sampled by the editor) with its cumulative lengths, in the owner's local pixels.ClassPathFollow2DComponent---- PathFollow2D ------------------------------------------------------------------------- Moves its actor along a Path2D: the path of `path` (another actor), or of the actor it is attached to.ClassPolygon2DComponent---- Polygon2D ---------------------------------------------------------------------------- A filled polygon, triangulated by the editor: `color` alone, or a texture mapped by the cooked per-vertex texels and multiplied by `color`.ClassRemoteTransform2DComponent---- RemoteTransform2D -------------------------------------------------------------------- Copies this actor's world position, rotation and/or scale onto `target` every simulation step, so a node can follow another without being attached to it.ClassVisibleOnScreenNotifier2DComponent---- VisibleOnScreenNotifier2D ------------------------------------------------------------ Tracks whether `rect` (owner-local x, y, width, height) is inside the current view.Class

Functions and methods

~AudioPlayer2DComponentReleases the resources owned by `epok::AudioPlayer2DComponent`.destructor~Line2DComponentReleases the resources owned by `epok::Line2DComponent`.destructor~Particles2DComponentReleases the resources owned by `epok::Particles2DComponent`.destructor~Path2DComponentReleases the resources owned by `epok::Path2DComponent`.destructor~PathFollow2DComponentReleases the resources owned by `epok::PathFollow2DComponent`.destructor~Polygon2DComponentReleases the resources owned by `epok::Polygon2DComponent`.destructor~RemoteTransform2DComponentReleases the resources owned by `epok::RemoteTransform2DComponent`.destructor~VisibleOnScreenNotifier2DComponentReleases the resources owned by `epok::VisibleOnScreenNotifier2DComponent`.destructoradd_pointAdds point as part of the world2d content module.MethodadvanceOne simulation step: advance, then place the actor.Methodangle_degreesAngle of a vector in Q12 degrees, from +X towards +Y (clockwise on screen), in (-180, 180].Functionbegin_playBegins play as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodclear_pointsClears points as part of the world2d content module.Methodend_playEnds play as part of the world2d content module.Methodfollow_nodesMoves the points onto the followed nodes.Methodget_alive_countReturns alive count as part of the world2d content module.Methodget_lengthReturns length as part of the world2d content module.Methodget_point_countReturns point count as part of the world2d content module.Methodget_point_xReturns point x as part of the world2d content module.Methodget_point_yReturns point y as part of the world2d content module.Methodget_progressReturns progress as part of the world2d content module.Methodget_progress_ratioReturns progress ratio as part of the world2d content module.Methodget_speedReturns speed as part of the world2d content module.Methodget_targetReturns target as part of the world2d content module.Methodis_emittingReports whether emitting as part of the world2d content module.Methodis_movingReports whether moving as part of the world2d content module.Methodis_on_screenReports whether on screen as part of the world2d content module.Methodis_playingReports whether playing as part of the world2d content module.Methodisqrt64Integer square root of a non-negative 64-bit value.Functionlength_2dLength of a Q12 vector, in Q12.Functionlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodlevel_attachedPerforms `level attached` as part of the world2d content module.Methodon_disablePerforms `on disable` as part of the world2d content module.MethodplayStarts play as part of the world2d content module.MethodpushPushes the transform once.MethodreleasablePerforms `releasable` as part of the world2d content module.Methodremove_pointRemoves point as part of the world2d content module.Methodresolve_pathThe Path2D this follower uses.MethodrestartStarts a one-shot burst again (or restarts a stream).Methodsample_localThe local point and unit direction at `distance` along the path, clamped (or wrapped, for a closed path) to its length.Methodsample_xWorld position at `distance` along the path.Methodsample_yPerforms `sample y` as part of the world2d content module.Methodset_clipSets clip as part of the world2d content module.Methodset_colorSets color as part of the world2d content module.Methodset_colorsSets colors as part of the world2d content module.Methodset_emittingSets emitting as part of the world2d content module.Methodset_movingSets moving as part of the world2d content module.Methodset_pitchSets pitch as part of the world2d content module.Methodset_pointSets point as part of the world2d content module.Methodset_progressSets progress as part of the world2d content module.Methodset_progress_ratioProgress as a fraction (0..1) of the path's length.Methodset_speedSets speed as part of the world2d content module.Methodset_targetSets target as part of the world2d content module.Methodset_visibleSets visible as part of the world2d content module.Methodset_visibleSets visible as part of the world2d content module.Methodset_visibleSets visible as part of the world2d content module.Methodset_volumeSets volume as part of the world2d content module.Methodset_widthSets width as part of the world2d content module.Methodset_world_positionMoves the owner's root so its world position becomes `world`, through the inverse of the parent chain's linear part when the root is attached.FunctionspatializeLoudness and pan for a listener at `listener` (world pixels).MethodstopStops stop as part of the world2d content module.Methodstop_followingStops following nodes: the points stay where they are and are the line's own again.Methodtake_finishedTrue once after a one-shot burst's last particle died.Methodtake_screen_enteredPerforms `take screen entered` as part of the world2d content module.Methodtake_screen_exitedPerforms `take screen exited` as part of the world2d content module.Method

Fields, variables and values

accumulatorRuntime state, owned by the service.FieldaliveExposes `alive` on `epok::Particles2DComponent` for the world2d content module.FieldamountExposes `amount` on `epok::Particles2DComponent` for the world2d content module.Fieldattenuationexponent of the fade: 1 linear, 2 faster near the edgeFieldaudio_playersExposes `audio_players` on the `epok::world2d` namespace for the world2d content module.VariableautoplayExposes `autoplay` on `epok::AudioPlayer2DComponent` for the world2d content module.Fieldbegin_colorExposes `begin_color` on `epok::Line2DComponent` for the world2d content module.FieldblendExposes `blend` on `epok::Line2DComponent` for the world2d content module.FieldblendExposes `blend` on `epok::Particles2DComponent` for the world2d content module.FieldblendExposes `blend` on `epok::Polygon2DComponent` for the world2d content module.FieldCircleNamed value `Circle` in `epok::EmissionShape2D`.Enum valueclosedExposes `closed` on `epok::Line2DComponent` for the world2d content module.FieldclosedExposes `closed` on `epok::Path2DComponent` for the world2d content module.FieldcolorExposes `color` on `epok::Polygon2DComponent` for the world2d content module.FielddampingExposes `damping` on `epok::Particles2DComponent` for the world2d content module.FielddirectionExposes `direction` on `epok::Particles2DComponent` for the world2d content module.Fielddisable_when_hiddenExposes `disable_when_hidden` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.FieldemittedExposes `emitted` on `epok::Particles2DComponent` for the world2d content module.FieldemittersExposes `emitters` on the `epok::world2d` namespace for the world2d content module.VariableemittingExposes `emitting` on `epok::Particles2DComponent` for the world2d content module.Fieldend_colorExposes `end_color` on `epok::Line2DComponent` for the world2d content module.Fieldend_colorExposes `end_color` on `epok::Particles2DComponent` for the world2d content module.FieldenteredExposes `entered` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.FieldexitedExposes `exited` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.FieldexplosivenessExposes `explosiveness` on `epok::Particles2DComponent` for the world2d content module.Fieldextentshalf size of the rectangle; [0] is the circle radiusFieldfinishedExposes `finished` on `epok::Particles2DComponent` for the world2d content module.FieldfollowNodes the line runs through, in order: the service moves the points onto them every step (ropes, chains, beams between moving things).Fieldfollow_countExposes `follow_count` on `epok::Line2DComponent` for the world2d content module.FieldfollowersExposes `followers` on the `epok::world2d` namespace for the world2d content module.VariablegravityExposes `gravity` on `epok::Particles2DComponent` for the world2d content module.Fieldhframesframes across `region`, played over the lifetimeFieldknownExposes `known` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.Fieldlengthsdistance from the first point to each pointFieldlifetimeExposes `lifetime` on `epok::Particles2DComponent` for the world2d content module.Fieldline2d_follow_limitExposes `line2d_follow_limit` on the `epok` namespace for the world2d content module.Variableline2d_max_points---- Line2D ------------------------------------------------------------------------------- A polyline of up to `line2d_max_points` points drawn `width` pixels wide, its colour blending from `begin_color` to `end_color`.VariablelinesExposes `lines` on the `epok::world2d` namespace for the world2d content module.Variablelink2dExposes `link2d` on `epok::AudioPlayer2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::Line2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::Particles2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::Path2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::PathFollow2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::Polygon2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::RemoteTransform2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.Fieldlocal_coordsExposes `local_coords` on `epok::Particles2DComponent` for the world2d content module.Fieldloopingwrap at the ends (always, on a closed path)Fieldmax_distancepixelsFieldmovingExposes `moving` on `epok::PathFollow2DComponent` for the world2d content module.FieldnotifiersExposes `notifiers` on the `epok::world2d` namespace for the world2d content module.Variableoffsetalong / across the pathFieldon_screenExposes `on_screen` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.Fieldone_shotExposes `one_shot` on `epok::Particles2DComponent` for the world2d content module.Fieldpanning0 keeps the clip centred, 1 pans fully at the screen edgeFieldpathExposes `path` on `epok::PathFollow2DComponent` for the world2d content module.FieldpathsExposes `paths` on the `epok::world2d` namespace for the world2d content module.Variableping_pongor turn back at the endsFieldPointNamed value `Point` in `epok::EmissionShape2D`.Enum valuepoint_countExposes `point_count` on `epok::Line2DComponent` for the world2d content module.Fieldpoint_countExposes `point_count` on `epok::Path2DComponent` for the world2d content module.FieldpointsExposes `points` on `epok::Line2DComponent` for the world2d content module.Fieldpointsx, y pairsFieldpolygonsExposes `polygons` on the `epok::world2d` namespace for the world2d content module.VariableprogressExposes `progress` on `epok::PathFollow2DComponent` for the world2d content module.FieldrectExposes `rect` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.FieldRectangleNamed value `Rectangle` in `epok::EmissionShape2D`.Enum valueregionExposes `region` on `epok::Particles2DComponent` for the world2d content module.Fieldrelease_particlesParticles live in the service's pool; an emitter releases its own when it goes away.VariableremotesExposes `remotes` on the `epok::world2d` namespace for the world2d content module.Variablerotatesturn the actor to the path's directionFieldscalestart, endFieldseedExposes `seed` on `epok::Particles2DComponent` for the world2d content module.FieldshapeExposes `shape` on `epok::Particles2DComponent` for the world2d content module.FieldsourceExposes `source` on `epok::AudioPlayer2DComponent` for the world2d content module.FieldspeedExposes `speed` on `epok::Particles2DComponent` for the world2d content module.FieldspeedExposes `speed` on `epok::PathFollow2DComponent` for the world2d content module.FieldspreadExposes `spread` on `epok::Particles2DComponent` for the world2d content module.Fieldstart_colorExposes `start_color` on `epok::Particles2DComponent` for the world2d content module.Fieldstatic_class_idExposes `static_class_id` on `epok::AudioPlayer2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::Line2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::Particles2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::Path2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::PathFollow2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::Polygon2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::RemoteTransform2DComponent` for the world2d content module.Variablestatic_class_idExposes `static_class_id` on `epok::VisibleOnScreenNotifier2DComponent` for the world2d content module.VariabletargetExposes `target` on `epok::RemoteTransform2DComponent` for the world2d content module.Fieldtexelsu, v pairs, when texturedFieldtextureExposes `texture` on `epok::Particles2DComponent` for the world2d content module.FieldtextureExposes `texture` on `epok::Polygon2DComponent` for the world2d content module.Fieldtriangle_countExposes `triangle_count` on `epok::Polygon2DComponent` for the world2d content module.Fieldtrianglesthree vertex indices eachFieldupdate_positionExposes `update_position` on `epok::RemoteTransform2DComponent` for the world2d content module.Fieldupdate_rotationExposes `update_rotation` on `epok::RemoteTransform2DComponent` for the world2d content module.Fieldupdate_scaleExposes `update_scale` on `epok::RemoteTransform2DComponent` for the world2d content module.Fieldvertex_countExposes `vertex_count` on `epok::Polygon2DComponent` for the world2d content module.Fieldverticesx, y pairsFieldvisibleExposes `visible` on `epok::Line2DComponent` for the world2d content module.FieldvisibleExposes `visible` on `epok::Particles2DComponent` for the world2d content module.FieldvisibleExposes `visible` on `epok::Polygon2DComponent` for the world2d content module.Fieldvolumebefore distance attenuationFieldwidthExposes `width` on `epok::Line2DComponent` for the world2d content module.Fieldz_indexExposes `z_index` on `epok::Line2DComponent` for the world2d content module.Fieldz_indexExposes `z_index` on `epok::Particles2DComponent` for the world2d content module.Fieldz_indexExposes `z_index` on `epok::Polygon2DComponent` for the world2d content module.Field