Objects and singletons

From vx
Jump to: navigation, search

Hey you! If you notice any undocumented parts of vx, please let me know! That, or put the changes in and tell me about it.

Contents

[edit] Objects and singletons

[edit] Objects

These are objects that vx uses to wrap raw LuaVerge code. You create instances of them, and then you can manipulate them through their attributes and methods.

vx.Image

vx.Font

  • A bitmap font handle that can do a bunch of printing operations.

vx.Sound

  • A non-looping sound effect that can be played across several channels.

vx.Song

  • A looping music track that can be played, and has moderately advanced seeking and pausing capabilities.

vx.Socket

  • A network socket that allows communication with remote clients.

vx.Sprite

  • A sprite handle, which can be used for things like particle effects and lightweight entities. Somewhat advanced, but powerful.

vx.Entity

  • An entity handle, which interacts with the map it is placed in, and has a CHR spritesheet.

vx.File

  • A file handle, which can either read from or write to the disk.
  • vx.FileMode
    • This table contains all the modes possible when opening a file.
  • vx.SeekMode
    • This table contains options that affect the behaviour of the vx.File:Seek method.

[edit] Internal classes

These are internal classes for which instances are provided by vx already, and you can't create yourself. They are variables contained in the vx namespace.

vx.Map

  • A singleton object that handles all map interaction.

vx.Camera

  • A singleton object that handles all the camera interaction

vx.Button

  • An internal object that represents some button's state.

vx.Clock

  • A singleton object that handles timing operations.

vx.Music

  • A singleton object that handles the "simple" music interaction

[edit] Notes

Most of the objects that vx gives you are made possible through the class system that comes with vx. It allows object-orientation, and better data encapsulation of the raw internals that Verge has.

There are also a few low-level details behind-the-scenes to help in the binding. I haven't bothered explaining these yet, because they're over the heads of a lot of people. But you can check out the vx source if you want to look at the full gritty details.

Personal tools