q5play
    Preparing search index...

    Class Q5Play

    Index

    Constructors

    Properties

    context: string
    friendlyRounding: boolean

    Friendly rounding makes some Sprite getters return nice rounded numbers if a decimal value is within linear slop range (+/-0.005) or angular slop range (+/-0.000582 radians) of a whole number.

    This is because Box2D physics calculations can result in floating point drift, which beginners wouldn't expect.

    Setting to false can slightly improve performance.

    true
    
    groups: { [key: number]: Group }

    Contains all the groups in the sketch.

    The keys are the group's unique ids.

    groupsCreated: number
    hasMouse: boolean
    os: {}

    Information about the operating system being used.

    palettes: any[]

    The default color palette, at index 0 of this array, has all the letters of the English alphabet mapped to colors.

    renderStats: boolean

    Displays the version of q5play being used, the number of sprites being drawn and a realtime graphing of the current FPS.

    FPS in this context refers to how many frames per second your computer can generate, only based on the physics calculations and other processes necessary to generate a frame, but not including the delay between when frames are actually shown on the screen. The higher the FPS, the better your game is performing.

    You can use this function for approximate performance testing. But for the most accurate results, use your web browser's performance testing tools.

    Generally having less sprites and using a smaller canvas will make your game perform better. Also drawing images is faster than drawing shapes.

    false
    
    sprites: { [key: number]: Sprite }

    Contains all the sprites in the sketch.

    Users should use the allSprites group instead because this object includes deleted sprites.

    The keys are the sprite's unique ids.

    spritesCreated: number
    spritesDrawn: number
    standardizeKeyboard: boolean

    Methods

    • Runs automatically after each q5.draw function call.

      Returns void

    • "Made with q5play" splash screen displayed during initial page load by default.

      Returns Promise<void>

    • Runs automatically before each q5.draw function call.

      Returns void