Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
RG_TILE(3)		     Library Functions Manual		      RG_TILE(3)

NAME
     RG_Tile -- Agar-RG image element

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

DESCRIPTION
     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 in-
     terface to display graphics.

     The following types of elements are implemented:

     RG_TILE_PIXMAP   Blit the given surface (a RG_Pixmap(3) reference) at  tar-
		      get coordinates x, y with alpha blending factor alpha.

     RG_TILE_SKETCH   Blit  a rendering of the given vector drawing at x, y, us-
		      ing 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  imple-
		      mented.	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;
     };

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

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

     void RG_TileGenerate(RG_Tile *tile)

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

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

     RG_TileElement * RG_TileAddFeature(RG_Tile *tile, const char *name, RG_Fea-
     tureOps *featureOps, int x, int y)

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

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

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

     The RG_TileNew()  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.

     RG_TileScale()  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 RG_TileGenerate() function updates the surface (the su  member  of  the
     RG_Tile structure) using the tile instructions.

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

     RG_TileAddPixmap()  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 fea-
     tures, the x and y parameters may or may not have any meaning.  See RG_Fea-
     ture(3) for more information on the feature framework.

     RG_TileDelFeature(), 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  decre-
     mented.   If  destroyFlag	is 1, the element is automatically freed is that
     reference count reaches 0.

SEE ALSO
     RG(3), RG_Feature(3), RG_Pixmap(3), RG_Sketch(3),	RG_Texture(3),	RG_Tile-
     view(3)

Agar 1.7			December 21, 2022		      RG_TILE(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=RG_Tile&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help