Sign in

    selene-canvas

    Game Engine
    Download zip
    Author
    Version
    0.13.2
    License
    Apache-2.0
    Last updated
    last year
    Downloads
    102

    #A Selene Backend with Canvas2D/JavaScript

    #Instruction

    Copy the provided index.html to the root path of your project.

    Replace the source file path with your actual file path.

    Build your project with

    moon build --target js

    Run the server with any Web Server such as

    python3 -m http.server 8000

    Finally, you can play your game by accessing localhost:8000 in your browser.

    Audio

    type Audio

    Audio::new

    fn Audio::new(path : String) -> Audio

    Audio::pause

    fn Audio::pause(self : Audio) -> Unit

    Audio::play

    fn Audio::play(self : Audio) -> Unit

    Audio::set_loop

    fn Audio::set_loop(self : Audio, loop_ : Bool) -> Unit

    Audio::set_volume

    fn Audio::set_volume(self : Audio, volume : Double) -> Unit

    CanvasBackend

    type CanvasBackend

    CanvasBackend::new

    document_add_event_listener

    fn document_add_event_listener(event : String, callback : (
    Event
    ) -> Unit) -> Unit

    is_pointer_locked

    fn is_pointer_locked(canvas :
    HTMLCanvasElement
    ) -> Bool

    request_pointer_lock

    fn request_pointer_lock(elem :
    HTMLCanvasElement
    ) -> Unit

    set_image_smoothing_enabled

    fn set_image_smoothing_enabled(ctx :
    CanvasRenderingContext2D
    , value : Bool) -> Unit

    set_viewport_height

    fn set_viewport_height(elem :
    HTMLCanvasElement
    , height : Double) -> Unit

    set_viewport_width

    fn set_viewport_width(elem :
    HTMLCanvasElement
    , width : Double) -> Unit

    time_now

    fn time_now() -> Double

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io