Jsvx

From April
Revision as of 19:00, 2 April 2015 by ShaneDeMeulenaere (Talk | contribs) (Created page with "== The Boilerplate == Before we dive in, we need to discuss the basic building blocks of an application in Jsvx. === Vx_world === A vx_world is a collection of objects that can...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Boilerplate

Before we dive in, we need to discuss the basic building blocks of an application in Jsvx.

Vx_world

A vx_world is a collection of objects that can be rendered in the same scene. Most simple applications only need one vx_world, but nothing says you can’t have more. You can think of a vx_world as a setting, a scene, or a room. If objects can appear in the same camera frame, they need to be in the same vx_world.

Vx_buffer

A vx_buffer is a collection of objects in a vx_world that are rendered together. They represent a group of objects that can be “turned on and off”, similar to a layer in many photo editing platforms. Vx_buffers are also the only way to render objects in Jsvx. To render an object, or collection of objects, you follow these steps.

Ask the vx_world for a named buffer. (if a buffer with that name exists, the vx_world will return a pointer to the existing buffer) Add objects to the back of the buffer (vx_buffers implement double buffering to prevent tears and jitters during rendering.) https://docs.oracle.com/javase/tutorial/extra/fullscreen/doublebuf.html Swap the buffer.

Vx_canvas

A Vx_canvas represents a portion of a literal display device such as a computer monitor or a phone screen. (Does it? look through the code)

Vx_layer

A vx_layer represents a “view” into a vx_world. It acts like a moveable camera that inspects the scene (the vx_world). Vx_layers are also responsible for communicating user-initiated events such as mouse clicks and keystrokes to the server system.