menu
bullseye2d
bullseye2d.dart
bullseye2d
dark_mode
light_mode
bullseye2d
library
Classes
Accelerometer
Input
Provides access to the device's accelerometer data, including the force of gravity.
App
App
The base App
class. Extend from this class to create a Bullseye2D
application.
AppConfig
App
The configuration settings for the application.
Audio
Audio
Manages audio playback for sounds and music.
AudioVisualizer
Audio
Handles the setup and data retrieval for audio visualization using the Web Audio API.
BitmapFont
Graphics
A font rendered from a pre-generated texture atlas.
Char
Input
Represents a single character input event, including the character symbol
and the physical key code that produced it.
Gamepad
Input
Manages input from connected gamepads.
Graphics
Graphics
Provides the core 2D rendering capabilities for the Bullseye2D engine.
Image
Graphics
A drawable image, typically a sub-region of a Texture .
Keyboard
Input
Manages keyboard input, tracking key states (down, up, hit) and
buffering character input.
Loader
IO
Manages and tracks the progress of multiple asynchronous loading operations.
LoaderItem
IO
An individual item being tracked by the Loader .
LocalStorage
A utility class for managing state in the browser localStorage
.
Mouse
Input
Manages mouse and touch input.
Platform
Provides utility methods for detecting the current platform.
Point <T extends num >
A utility class for representing two-dimensional positions.
Rect <T extends num >
Utility
Represents a rectangle defined by a top-left corner left , top
and a width and height .
RenderBatchState
ResourceManager
IO
Manages the loading of game resources such as textures, images,
fonts, and sounds.
Sound
Audio
Manages an audio resource, its loading state, and playback properties.
Texture
Graphics
Represents a Texture.
Textures are reference-counted; use retain and dispose to manage their lifecycle.
TextureFlags
Graphics
Defines bitmask flags to control Texture behavior, such as filtering,
Properties
accel
→ Accelerometer
Core Systems
{@category Core_Systems}
Provides access to the device's accelerometer data.
no setter
audio
→ Audio
Core Systems
{@category Core_Systems}
Manages audio playback for sounds and music.
no setter
dartDoc
↔ bool ?
Features
Cheatsheet
Getting Started
My first App
This is just a unused variable to enforce the dart doc generator
to include topics that aren't attached to a specific classes or
functions.
{@category Getting_Started}
{@category TutorialFirstApp}
{@category Features}
{@category Cheatsheet}
getter/setter pair
die
→ dynamic
Debug
{@category Debug}
Behaves the same as error , but stops the application / launches the debugger
final
error
→ dynamic
Debug
{@category Debug}
Behaves the same as log , but uses error verbosity
final
f
↔ String
getter/setter pair
gamepad
→ Gamepad
Core Systems
{@category Core_Systems}
Handles gamepad input from connected controllers.
no setter
gfx
→ Graphics
Core Systems
{@category Core_Systems}
The main graphics interface for rendering 2D primitives, textures, and text.
no setter
info
→ dynamic
Debug
{@category Debug}
Behaves the same as log , but uses info verbosity
final
keyboard
→ Keyboard
Core Systems
{@category Core_Systems}
Manages keyboard input.
no setter
loader
→ Loader
Core Systems
{@category Core_Systems}
Manages the loading of game assets.
no setter
log
→ dynamic
Debug
{@category Debug}
Accepts a variable number of arguments for logging.
final
mouse
→ Mouse
Core Systems
{@category Core_Systems}
Manages mouse and touch input.
no setter
resources
→ ResourceManager
Core Systems
{@category Core_Systems}
Manages loading and caching of game resources like textures, fonts, and sounds.
no setter
warn
→ dynamic
Debug
{@category Debug}
Behaves the same as log , but uses warn verbosity
final
Functions
atan2Degree (num a , num b )
→ double
Utility
Calculates the angle in degrees for the point (b, a) using atan2(a, b)
.
colorFromInt (int vol )
→ Color
cos (num radians )
→ double
Converts radians
to a double and returns the cosine of the value.
cosDegree (num degree )
→ double
Utility
Calculates the cosine of an angle given in degree
s.
debugger ({bool when = true , String ? message })
→ bool
If when
is true, stop the program as if a breakpoint were hit at the
following statement.
encodeImageToDataURL (Images images , [int frame = 0 ])
→ Future <String ? >
IO
Encodes a specific frame from an Images list into a base64 Data URL string (PNG format).
load <T > (String path , Loader loadingInfo , {String responseType = "text" , T? defaultValue , void onError (Event event )?, dynamic onLoad (JSAny response , dynamic completer (T ), void onError (Event event ) )? })
→ Future <T >
IO
Asynchronously loads a file from the specified path
and returns its content
as type T
.
loadImageData (String path , Loader loadingInfo )
→ Future <HTMLImageElement ? >
IO
Asynchronously loads image data from the specified path
into an HTMLImageElement .
loadStringAsync (String url , Loader loadingInfo )
→ Future <String >
IO
Asynchronously loads a string from the specified url
.
logEnableStacktrace (bool enable )
→ dynamic
Debug
Prepend source location to all messages
logFilter ([String ? filter ])
→ dynamic
Debug
Configures log output filtering.
logOff ()
→ dynamic
Debug
Disables all logging output
logOn ()
→ dynamic
Debug
Enables all logging output
logReset ()
→ dynamic
Debug
Clears the tag stack
min <T extends num > (T a , T b )
→ T
Returns the lesser of two numbers.
nextPowerOfTwo (int v )
→ int
Utility
Calculates the next power of two greater than or equal to the given integer v
.
sin (num radians )
→ double
Converts radians
to a double and returns the sine of the value.
sinDegree (num degree )
→ double
Utility
Calculates the sine of an angle given in degree
s.
sqrt (num x )
→ double
Converts x
to a double and returns the positive square root of the
value.
stopEvent (Event event )
→ void
Utility
Stops the propagation and prevents the default action of a browser Event .
tanDegree (num degree )
→ double
Utility
Calculates the tangent of an angle given in degree
s.