<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://orx-project.org/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://orx-project.org/wiki/feed.php">
        <title>Orx Learning - en:examples:objects</title>
        <description></description>
        <link>https://orx-project.org/wiki/</link>
        <image rdf:resource="https://orx-project.org/wiki/_media/favicon.ico" />
       <dc:date>2026-04-04T21:57:16+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/coloring_an_object?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/comparing_strings?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/concatenating_two_strings?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/counting_all_objects?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/counting_objects_by_name?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/create_object?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/get_child_object_by_name?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/get_object_by_traversing_structures?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/get_object_name?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/keep_object_facing_mouse?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/kill_parent_object_when_children_die?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/non_rotating_children?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/number_to_string?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/object_get_set_rotation?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/object_with_children?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/object_with_shadow?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/string_in_string?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/turning_or_steering?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://orx-project.org/wiki/en/examples/objects/turning_or_steering_2?rev=1759253179&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://orx-project.org/wiki/_media/favicon.ico">
        <title>Orx Learning</title>
        <link>https://orx-project.org/wiki/</link>
        <url>https://orx-project.org/wiki/_media/favicon.ico</url>
    </image>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/coloring_an_object?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Coloring an Object</title>
        <link>https://orx-project.org/wiki/en/examples/objects/coloring_an_object?rev=1759253179&amp;do=diff</link>
        <description>Coloring an Object


orxVECTOR colorVec;
colorVec.fX = 1.0; //full red
colorVec.fY = 0.5; //half green
colorVec.fZ = 0;   //no blue = orange

orxCOLOR color;
color.vRGB = colorVec;
color.fAlpha = orxFLOAT_1; //set alpha (required) to stop your object from becoming fully transparent.

orxObject_SetColor(MyObject, &amp;color);</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/comparing_strings?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Comparing Strings</title>
        <link>https://orx-project.org/wiki/en/examples/objects/comparing_strings?rev=1759253179&amp;do=diff</link>
        <description>Comparing Strings

Code


if (orxString_Compare(&quot;String One&quot;, &quot;String Two&quot;) == 0) {
  // is the same			
} else {
  // is not the same
}

int value = orxString_Compare(&quot;aa&quot;, &quot;ab&quot;); //value is -1 (smaller)

int value2 = orxString_Compare(&quot;ab&quot;, &quot;aa&quot;); //value2 is 1 (larger)</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/concatenating_two_strings?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Concatenating two orxSTRINGs</title>
        <link>https://orx-project.org/wiki/en/examples/objects/concatenating_two_strings?rev=1759253179&amp;do=diff</link>
        <description>Concatenating two orxSTRINGs


#include &quot;orx.h&quot;
#ifdef __orxMSVC__ 
	#include &quot;malloc.h&quot;
#endif

...

const orxSTRING stringOne = &quot;I like the beach. &quot;;
const orxSTRING stringTwo = &quot;And I like the waves.&quot;;

int length = orxString_GetLength(stringOne) + orxString_GetLength(stringTwo) + 1;
#ifdef __orxMSVC__ 
	orxCHAR *concatenatedString = (orxCHAR *)alloca(length * sizeof(orxCHAR));
#else /* __orxMSVC__ */ 
	orxCHAR concatenatedString[length] = {};
#endif /* __orxMSVC__ */

orxString_NPrint(concat…</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/counting_all_objects?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Getting the total count of all Objects</title>
        <link>https://orx-project.org/wiki/en/examples/objects/counting_all_objects?rev=1759253179&amp;do=diff</link>
        <description>Getting the total count of all Objects

This function will return the total count of all current objects.

Code


orxU32 totalObjectsCount = orxStructure_GetCounter(orxSTRUCTURE_ID_OBJECT);


Counts of other structure types can also be called. See: orxSTRUCTURE_ID in the API</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/counting_objects_by_name?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Counting Objects by Name</title>
        <link>https://orx-project.org/wiki/en/examples/objects/counting_objects_by_name?rev=1759253179&amp;do=diff</link>
        <description>Counting Objects by Name

How to get a count of all objects with a particular name. In this case, both the ship and invader carry a bullet. This example counts all the BulletObjects.

Assets

  

Code


	int bulletObjectCount = 0; 
	
	orxSTRUCTURE *objectToCheck = orxStructure_GetFirst(orxSTRUCTURE_ID_OBJECT);
	while (objectToCheck != orxNULL){
		const orxSTRING name = orxObject_GetName(orxOBJECT(objectToCheck));
				
		if (orxString_Compare(name, &quot;BulletObject&quot;) == 0){
			bulletObjectCount++;
	…</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/create_object?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Create Object</title>
        <link>https://orx-project.org/wiki/en/examples/objects/create_object?rev=1759253179&amp;do=diff</link>
        <description>Create Object

Code


orxOBJECT *heroObject = orxObject_CreateFromConfig(&quot;HeroObject&quot;);


Config


[HeroObject]
Graphic  = HeroGraphic
Position = (320, 200, 0)

[HeroGraphic]
Texture = hero.png</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/get_child_object_by_name?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Getting a Child Object by Name from a Parent Object</title>
        <link>https://orx-project.org/wiki/en/examples/objects/get_child_object_by_name?rev=1759253179&amp;do=diff</link>
        <description>Getting a Child Object by Name from a Parent Object

Orx provides a pair of functions for finding objects in an object hierarchy by name. The two functions are orxObject_FindChild and orxObject_FindOwnedChild. These functions will filter out any camera or spawner and retrieve the child matching the provided path.</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/get_object_by_traversing_structures?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Get OrxObject by Traversing Structures</title>
        <link>https://orx-project.org/wiki/en/examples/objects/get_object_by_traversing_structures?rev=1759253179&amp;do=diff</link>
        <description>Get OrxObject by Traversing Structures
orxSTRUCTURE *structure = orxStructure_GetFirst(orxSTRUCTURE_ID_OBJECT);
while (structure != orxNULL){
	orxOBJECT *object = orxOBJECT(structure);
	const orxSTRING objectName = orxObject_GetName(object);
	orxSTRUCTURE *nextStructure = orxStructure_GetNext(structure); 
	if (orxString_Compare(objectName , &quot;SomeObjectName&quot;) == 0){
		orxObject_SetLifeTime(orxOBJECT(structure), orx2F(0.0));
	}
	structure = nextStructure;
}</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/get_object_name?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Get the Name of an Object</title>
        <link>https://orx-project.org/wiki/en/examples/objects/get_object_name?rev=1759253179&amp;do=diff</link>
        <description>Get the Name of an Object


const orxSTRING name = orxTexture_GetName(SomeObject);</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/keep_object_facing_mouse?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Keep an Object facing the Mouse Position</title>
        <link>https://orx-project.org/wiki/en/examples/objects/keep_object_facing_mouse?rev=1759253179&amp;do=diff</link>
        <description>Keep an Object facing the Mouse Position

Good for weapons that fire in the direction of the mouse

Resource



Config


[Arrow]
Graphic         = @
Texture         = arrow.png
Pivot           = center
Position        = (0, 0, 0)


Code


orxVECTOR arrowPosition = orxVECTOR_0;
orxObject_GetPosition(arrow, &amp;arrowPosition);
	
orxVECTOR mousePosition = orxVECTOR_0;
orxMouse_GetPosition(&amp;mousePosition);
orxRender_GetWorldPosition(&amp;mousePosition, orxNULL, &amp;mousePosition);
	
orxVECTOR direction = orxV…</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/kill_parent_object_when_children_die?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Having a Parent Object die after all children have died</title>
        <link>https://orx-project.org/wiki/en/examples/objects/kill_parent_object_when_children_die?rev=1759253179&amp;do=diff</link>
        <description>Having a Parent Object die after all children have died

This example shows children with a random lifetime, and the parent dying only after all children have expired.

Config


[WarningObject]
Position = (0, 0, -0.2)
ChildList = FlashingTopObject # IconObject # WarningTextObject 
LifeTime = child</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/non_rotating_children?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Non-rotating Child Objects</title>
        <link>https://orx-project.org/wiki/en/examples/objects/non_rotating_children?rev=1759253179&amp;do=diff</link>
        <description>Non-rotating Child Objects

For attaching children whose position follows the parent&#039;s rotation, but the child&#039;s direction vector does not change.

Assets

 

Code


orxObject_CreateFromConfig(&quot;BossObject&quot;);


Config


[BossObject]
Graphic = BossGraphic
Position = (400, 300, -0.1)
ChildList = Gun1 # Gun2 # Gun3 # Gun4
Smoothing = true
AngularVelocity = 36

[BossGraphic]
Texture = boss.png
Pivot = center

[Gun1@GunObject]
Position = (-55, -55, -0.1)
Rotation = -45

[Gun2@GunObject]
Position = (55…</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/number_to_string?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Convert a Number to a String</title>
        <link>https://orx-project.org/wiki/en/examples/objects/number_to_string?rev=1759253179&amp;do=diff</link>
        <description>Convert a Number to a String


orxS32 score = 1234;

orxCHAR formattedScore[6] = {};
orxString_NPrint(formattedScore, sizeof(formattedScore) - 1, &quot;%d&quot;, score);</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/object_get_set_rotation?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Get and Set Rotation on an Object</title>
        <link>https://orx-project.org/wiki/en/examples/objects/object_get_set_rotation?rev=1759253179&amp;do=diff</link>
        <description>Get and Set Rotation on an Object


orxOBJECT *heroObject = orxObject_CreateFromConfig(&quot;HeroObject&quot;);

orxFLOAT rotation = orxObject_GetRotation(heroObject);
rotation += 10;

orxObject_SetRotation(heroObject, rotation);</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/object_with_children?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Object with Children</title>
        <link>https://orx-project.org/wiki/en/examples/objects/object_with_children?rev=1759253179&amp;do=diff</link>
        <description>Object with Children

Code


orxOBJECT *heroObject = orxObject_CreateFromConfig(&quot;HeroObject&quot;);


Config


[HeroObject]
Graphic  = HeroGraphic
Position = (320, 200, 0)
ChildList = HeroChildObject

[HeroChildObject]
Graphic = HeroGraphic
Position = (20, 20, 0)

[HeroGraphic]
Texture = hero.png</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/object_with_shadow?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Object shadow using a child</title>
        <link>https://orx-project.org/wiki/en/examples/objects/object_with_shadow?rev=1759253179&amp;do=diff</link>
        <description>Object shadow using a child

Assets

 

Code


orxObject_CreateFromConfig(&quot;CannonObject&quot;);


Config


[CannonObject]
Graphic         = CannonGraphic
Smoothing       = true
Position        = (-80, -80, -0.1)
AngularVelocity = 100
ChildList       = CannonShadow

[CannonGraphic]
Texture = cannon.png
Pivot   = (18.5, 26, 0)


[CannonShadow]
Graphic          = CannonShadowGraphic
Position         = (-20, 20, 0)
IgnoreFromParent = position.rotation

[CannonShadowGraphic]
Texture = cannon-shadow.png
Pi…</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/string_in_string?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Get a string in a string</title>
        <link>https://orx-project.org/wiki/en/examples/objects/string_in_string?rev=1759253179&amp;do=diff</link>
        <description>Get a string in a string


  orxSTRING alphabet = (orxCHAR*)&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;
  orxU32 size = 3, pos = 4; 
  orxCHAR buffer[64]; 
  orxString_NPrint(buffer, sizeof(buffer), &quot;%.3s&quot;, alphabet + pos);


buffer contains “EFG”.</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/turning_or_steering?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Turning or Steering</title>
        <link>https://orx-project.org/wiki/en/examples/objects/turning_or_steering?rev=1759253179&amp;do=diff</link>
        <description>Turning or Steering

Good for vehicle steering or turning ships and planes.

Code


car = orxObject_CreateFromConfig(&quot;CarObject&quot;);

...

if(orxInput_IsActive(&quot;Right&quot;)){
  orxFLOAT rotation = orxObject_GetRotation(car);
	
  orxVECTOR relativeSpeed = orxVECTOR_0;
  orxObject_GetRelativeSpeed(car, &amp;relativeSpeed);
	
  rotation += 0.01;
  orxObject_SetRotation(car, rotation);
  orxObject_SetRelativeSpeed(car, &amp;relativeSpeed); //reapply the relative speed.
}</description>
    </item>
    <item rdf:about="https://orx-project.org/wiki/en/examples/objects/turning_or_steering_2?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Turning or Steering (method 2)</title>
        <link>https://orx-project.org/wiki/en/examples/objects/turning_or_steering_2?rev=1759253179&amp;do=diff</link>
        <description>Turning or Steering (method 2)

Good for vehicle steering or turning ships and planes. Doesn&#039;t use relative speed so functions are faster, and the seperate rotation and speed are handy for drifting effects.

Code


car = orxObject_CreateFromConfig(&quot;CarObject&quot;);

...

if(orxInput_IsActive(&quot;Right&quot;)){
  orxFLOAT rotation = orxObject_GetRotation(car);

  orxVECTOR speed;
  orxObject_GetSpeed(car, &amp;speed);

  rotation += 0.01;
  orxVector_2DRotate(&amp;speed, &amp;speed, 0.01);
  orxObject_SetRotation(car, r…</description>
    </item>
</rdf:RDF>
