LoginLogin

Is there a way to display the collition box?

Root / Programming Questions / [.]

raimondzCreated:
Hi, I'm having problems with collision box. Right now, I have sprites with their home redefined that can be rotated and scaled but the collision box remain the same. The sprite number could be anything because I created a function to create the sprites with data instead of hard code. Is there a way to see the collition box?. Also, is there a way to detect collition by pixel instead?

Man, I wish there was a hitbox viewer for debug mode. You'd have to make one yourself, sorry. Sprites only get one hitbox each, and that's your lot for collision. EDIT: Whoops, I didn't even notice your original question. There's a flag in SPCOL that enables hitbox adjustment on scaling. Check the help, I'm ill and tired right now.

Thanks but that doesn't solve the problem at all. I had to define the collition box again and use the scale property to solve the problem. Edit: By define the collition box again, I mean this: SPCOL sprite_number, x,y,w,h,flag . Before I was using only SPCOL sprite_number,flag. Since I'm using SPHOME, I had to move the collision box because that wasn't done automatically.

Thanks but that doesn't solve the problem at all. I had to define the collition box again and use the scale property to solve the problem.
There's a flag in SPCOL that enables hitbox adjustment on scaling.
That's exactly what I told you to do?

Also, is there a way to detect collition by pixel instead?
You can check whats been drawn to the screen at a certain pixel location with GSPOIT
Variable = GSPOIT( X-coordinate,Y-coordinate )
Return Values Color code consisting of an 8-bit value for each ARGB element

I need help with collision!

Also, is there a way to detect collition by pixel instead?
You can check whats been drawn to the screen at a certain pixel location with GSPOIT
Variable = GSPOIT( X-coordinate,Y-coordinate )
Return Values Color code consisting of an 8-bit value for each ARGB element
I thought that only apply to the graphic layer. Well, I'm going to test that a tell you if that work.

I thought that only apply to the graphic layer. Well, I'm going to test that a tell you if that work.
You aren't wrong. GSPOIT is for reading from a graphic page.
* By default, GRP4 contains sprites and GRP5 contains BG images.
You can use your sprite's offsets to check if the sprite is solid at a certain pixel on the sprite graphic page, and then check if the destination pixel is solid on your BG or main page.