LoginLogin

Canvas Demo

Root / Submissions / [.]

AveryCreated:
Download:QRAPKX23
Version:Size:
Demonstrates using the sprite functions to offset, scale, and rotate a virtual canvas. Now that I have a sloppily put together prototype, I'm thinking this could be remade form scratch and then built upon.

Instructions:

Preferably, start CANVASDEMO.PRG. Up+Touch: Move canvas Right+Touch: Scale & rotate canvas Down: Reset canvas position, rotation, and scale Touch: Draw Left+Touch: Erase X: Erase canvas Y: Fill canvas L: Help

Cool; this could be really helpful (if you commented fairly well).

Replying to:haloopdy
Cool; this could be really helpful (if you commented fairly well).
Haha, no I didn't. xD

Nice! This could be very helpful down the road. Thank you.

Awesome!

Uses sprites for every single pixel? How can it possibly do that?

Replying to:MZ952
Uses sprites for every single pixel? How can it possibly do that?
The canvas is one large sprite. SPOFS and SPHOME move it. SPROT rotates it and SPSCALE makes it bigger and smaller.

Replying to:MZ952
Uses sprites for every single pixel? How can it possibly do that?
Does it edit the sprite page during program execution?

Replying to:MZ952
Uses sprites for every single pixel? How can it possibly do that?
Yes. Thankfully, SmileBASIC's sprites actively reference the sprite page during execution. If the sprite page is edited, the change is immediately shown in the sprites. When the screen is touched to be drawn on, a few math functions take the touch point, and adjust it for the canvas' position, scale, and rotation, to apply it to the sprite screen to draw on it.

Replying to:MZ952
Uses sprites for every single pixel? How can it possibly do that?
That's just pure genius. I have been trying to come up with a nifty way to render, re-render and manipulate a raster image, but I would have never thought of manipulating the sprite page. I've tried everything from just plain graphical commands to vector plotting, they all had created excessive lag on the O3DS system. I wonder how many frames it takes to load and display individual sprite pages.

Replying to:MZ952
Uses sprites for every single pixel? How can it possibly do that?
Loading from the filesystem is still slow. As far as using it instead of GPSET, it's much faster (and comes with the sprite manipulation features available).

i found defy 1.8 in here before its release WHOO-HOO!