creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Different kinds of Position?   
Papriko
Peppery One

Papriko
Germany  


  1/24/2010

Nothing really important, I was just wondering something in C3/DS CAOS:

Where is the difference between the position variables POSL + POST and POSX + POSY?


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
ylukyun
Patient Pirate

ylukyun

Manager



  1/24/2010

One returns the position of the center of the object, the other returns the position of a bounding box. Since you have left,right,up,down and not just x and y, I think it returns the positions of sides of a square around the object (like a border). But I don't know, as I don't know exactly what a bounding box is.
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  1/24/2010

POSL - leftmost edge of object
POST - topmost edge of object
POSX - X position at center
POSY - Y position at center

The bounding box is, AFAIK, simply the sprite itself: all sprites are "boxes" since they are squares, even though parts of them are transparent.



 
Papriko
Peppery One

Papriko



  1/24/2010

Aaahh, thats it! Thank you both, I was already wondering what why is where and if and... whatever XD

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
AquaShee

AquaShee



  1/24/2010

Actually, bounding boxes are more diamond-shaped rather than rectangular.

The 'corners' of the bounding box are at the middle top, middle bottom, middle left and middle right. You can see this with the 'dcor' CAOS command.
'targ hots dcor 1' should show you the bounding box of any object, and you'll see what I mean.

It's very important to keep this in mind, because this means a tiny object can have a lot of trouble checking if it is touching a much larger object because it has to be quite close to the center of the bottom of the larger object for the bounding boxes to touch.

This also means it's important to make sure any objects with a thin bottom (a spinning top, for example) touches the ground in the very center of it's sprite, or it'll appear to float on slopes.


The Community Scribble: make (y)our own metaroom!
 
Gumbo

Gumbo



  1/30/2010

would POSR be leftmost? would POSB be bottommost?


in the spring you gotta let the flowers fully blossom

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  1/30/2010

Yes, POSB is Bottommost, but POSR is Rightmost. (I assume that's what you meant?)


 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
1 online
RisenAngel
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki