GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RG_TILE(3) FreeBSD Library Functions Manual RG_TILE(3)

RG_TileAgar-RG image element

#include <agar/core.h>
#include <agar/gui.h>
#include <agar/map/rg.h>

The RG_Tile structure describes a graphical surface generated from a set of instructions or ‘elements’.

Note: Unless you need to generate or manipulate tiles programmatically, you do not need to use this interface. Libraries such as MAP(3) use this interface to display graphics.

The following types of elements are implemented:

RG_TILE_PIXMAP
Blit the given surface (a RG_Pixmap(3) reference) at target coordinates x, y with alpha blending factor alpha.
RG_TILE_SKETCH
Blit a rendering of the given vector drawing at x, y, using scale factor scale and alpha blending factor alpha.
RG_TILE_FEATURE
Generic graphical operation. Features may or may not have associated target coordinates. Filters such as ‘Blur’ are implemented as features. New features are easily implemented. See RG_Feature(3) for more information on the feature framework.

The public members of the RG_Tile structure are as follows:

typedef struct rg_tile {
	char name[RG_TILE_NAME_MAX];    /* User description */
	char clname[RG_TILE_CLASS_MAX]; /* Category (app-specific) */
	AG_Surface *su;                 /* Generated surface */
	int xOrig, yOrig;               /* Origin coordinates */
	enum rg_snap_mode {
		RG_SNAP_NONE,           /* No snapping */
		RG_SNAP_TO_GRID         /* Snap to grid */
	} snap_mode;
};

RG_Tile *
(RG_Tileset *tileset, const char *name, Uint16 width, Uint16 height, Uint flags);


void
(RG_Tileset *tileset, RG_Tile *tile, Uint16 width, Uint16 height);


void
(RG_Tile *tile);


RG_TileElement *
(RG_Tile *tile, const char *name, RG_Pixmap *pixmap, int x, int y);


RG_TileElement *
(RG_Tile *tile, const char *name, RG_Sketch *sketch, int x, int y);


RG_TileElement *
(RG_Tile *tile, const char *name, RG_FeatureOps *featureOps, int x, int y);


void
(RG_Tile *tile, RG_Pixmap *pixmap, int destroyFlag);


void
(RG_Tile *tile, RG_Sketch *sketch, int destroyFlag);


void
(RG_Tile *tile, RG_Feature *feature, int destroyFlag);

The () function allocates, initializes, and attaches a new RG_Tile of width by height pixels. name is a string identifier for the tile (if a tile of the same name exists, a unique name will be generated automatically). Accepted flags include:

RG_TILE_SRCCOLORKEY
Use colorkeying with the tile surface.
RG_TILE_SRCALPHA
Use alpha blending with the tile surface.

() resizes the canvas of the tile to width by height pixels. Note that this only resizes the canvas used for rendering the tile, and has no effect on the pixmaps and other features.

The () function updates the surface (the su member of the RG_Tile structure) using the tile instructions.

() searches for a tile element by type and name.

() inserts a reference to pixmap at coordinates x, y. RG_TileAddSketch() inserts a reference to sketch at coordinates x, y. RG_TileAddFeature() inserts the feature described by featureOps. For features, the x and y parameters may or may not have any meaning. See RG_Feature(3) for more information on the feature framework.

(), RG_TileDelPixmap() and RG_TileDelSketch() remove any element that refers to the given pixmap, sketch or feature, respectively. This causes the reference count of the referenced element to be decremented. If destroyFlag is 1, the element is automatically freed is that reference count reaches 0.

RG(3), RG_Feature(3), RG_Pixmap(3), RG_Sketch(3), RG_Texture(3), RG_Tileview(3)

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.