EPOK RUNTIME
epok::AudioPlayer2DComponent
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
---- 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.
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_content.hpp"
epok::AudioPlayer2DComponent& value = /* obtain a valid instance from your game */;Fields and constants
attenuationexponent of the fade: 1 linear, 2 faster near the edgeFieldautoplayExposes `autoplay` on `epok::AudioPlayer2DComponent` for the world2d content module.Fieldlink2dExposes `link2d` on `epok::AudioPlayer2DComponent` for the world2d content module.Fieldmax_distancepixelsFieldpanning0 keeps the clip centred, 1 pans fully at the screen edgeFieldsourceExposes `source` on `epok::AudioPlayer2DComponent` for the world2d content module.Fieldstatic_class_idExposes `static_class_id` on `epok::AudioPlayer2DComponent` for the world2d content module.Variablevolumebefore distance attenuationFieldPublic methods
~AudioPlayer2DComponentReleases the resources owned by `epok::AudioPlayer2DComponent`.destructorbegin_playBegins play as part of the world2d content module.Methodclass_idPerforms `class id` as part of the world2d content module.Methodend_playEnds play as part of the world2d content module.Methodis_playingReports whether playing 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.MethodreleasablePerforms `releasable` as part of the world2d content module.Methodset_clipSets clip as part of the world2d content module.Methodset_pitchSets pitch as part of the world2d content module.Methodset_volumeSets volume as part of the world2d content module.MethodspatializeLoudness and pan for a listener at `listener` (world pixels).MethodstopStops stop as part of the world2d content module.Method