-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
Feature RequestNew feature or user-story you wanna add to flipperNew feature or user-story you wanna add to flipperJSJS Runtime, loader and APIJS Runtime, loader and API
Description
Description of the feature you're suggesting.
I would like to request a JavaScript API for opening a bitmap format representing graphics and for drawing them to the screen. This is a powerful and efficient pattern for drawing graphics.
Basically each sprite in a spritesheet is perhaps 8x8 pixels while the overall sheet is perhaps 64x64 pixels. Then one programmatically chooses one of the sprites in the sheet and provides a coordinate to draw the sprite at.
The API could look like this:
let sprites = require('spritesheet');
let sheet = sprites.load('mysheet.bmp', 8, 8); // w, h
sprites.drawToScreen(sheet, 3, 8, 16);
This draws the fourth entry (index 3 when 0 based) in the spritesheet to pixel coordinate x=8, y=16. The drawn entry is 8x8 pixels.
I used bmp as an example but it could be gif or pcx or whatever format Flipper already uses.
Anything else?
This would allow for interesting game development.
Metadata
Metadata
Assignees
Labels
Feature RequestNew feature or user-story you wanna add to flipperNew feature or user-story you wanna add to flipperJSJS Runtime, loader and APIJS Runtime, loader and API