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

FreeBSD Manual Pages

  
 
  

home | help
image_origo_offset(3)		  Arcan Lua API 	   image_origo_offset(3)

NAME
     image_origo_offset - Shift the current object rotation and anchoring offset

SYNOPSIS
     nil
     image_origo_offset( vid:dst, number:xofs, number:yofs )
     image_origo_offset( vid:dst, number:xofs, number:yofs, number:zofs=0.0 )
     image_origo_offset( vid:dst, number:xofs, number:yofs, number:zofs=0.0 )
     image_origo_offset(  vid:dst,  number:xofs,  number:yofs,	number:zofs=0.0,
     int:anchor )

DESCRIPTION
     By default, the rotation origo for each object is set to its  local  center
     (0.5*w, 0.5*h). This function can be used to add an offset value to that.

     For  anchoring,  the valid anchor	values are: ANCHOR_UL  : upper-left, AN-
     CHOR_CR  : upper-center, ANCHOR_UR  : upper-right,  ANCHOR_CL    :  center-
     left,  ANCHOR_C	: center, ANCHOR_CR  : center-right, ANCHOR_LL	: lower-
     left, ANCHOR_LC  : lower-center, ANCHOR_LR  : lower-right.

NOTES
     1	    Rotation offset is relative to the local object itself. For  complex
	    object  hierarchies, the bounding volume would have to be calculated
	    and each object shifted in turn.

EXAMPLE
     function image_origo_offset0()
	   a = fill_surface(32, 32, 255, 0, 0);
	   b = fill_surface(32, 32, 0, 255, 0);
	   show_image({a, b});
	   move_image(a, 50, 100);
	   move_image(b, 100, 100);
	   rotate_image(a, 45);
	   rotate_image(b, 45);
	   image_origo_offset(b, -10, -10);
     end

EXAMPLE
     function image_origo_offset1()
		 a = fill_surface(128, 128, 255, 0, 0)
	   b = fill_surface(32, 32, 0, 255, 0);
	   show_image({a, b})
	   link_image(a, b, ANCHOR_LR)
	   image_origo_offset(a, 0, 0, 0, ANCHOR_C)
     end

image				   August 2026		   image_origo_offset(3)

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

home | help