ResourcePack

Jan 12, 2018
ResourcePack
  • ArcadeBoard API - ResourcePack


    Introduction(top)

    By default you can use any ASCII or UTF character when drawing pixels on the canvas. However these characters are limited or not correctly sized making them hard to use.

    Resource packs are very well integrated in the plugin, allowing you to draw sprites without having to deal with the creation of resource packs. The plugin will handle the creation, you just need to remember the name you gave to individual sprites.


    Based on your resource pack settings you provide the pack can be forced to the user (forced as in: If you don't want it, you can't play).

    ResourceIcon(top)

    A resource icon is an icon (image) that will replace an unused UTF-8 character. You do not have to worry about which character is replaced, or remember the character.

    ResourceSong(top)

    A resource song is a song that will replace a juke box song. It can be used for in-game music or effects.

    Usage(top)


    Adding an icon(top)

    Adding an icon takes two arguments. The first being a name you give to your icon and the second being a file or an input stream.
    Code (Text):
    resourcePack.addIcon("PACMAN_IDLE",new File(....));
    Note: You can automatically generate rotated versions of your icon by specifying "allowRotation"

    Using an icon(top)

    Using an icon is as simple as getting it by the name you created it with.
    Code (Text):
    resourcePack.getIconByName("PACMAN_IDLE");
    The above code returns a "ResourceIcon" that has a toString() method you can use.
    Note: When you've added the icon with "allowRotation" you can use toString(rotation)
    rotation is a number between 0 and 3
  • Loading...
  • Loading...