Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How to colour physics sprite? ( ͡° ͜ʖ ͡°)

Author
Message
THE_NOTORIOUS_PIGGY
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location:
Posted: 14th Jul 2016 05:51
Hello, I'm trying to colour a physics shape. It is set up like this.
SetSpriteShapeBox(underhoop,0,1,60,20,0)
setSpritePhysicsOn(underhoop,1)

You can see it when I do SetPhysicsDebugOn(). Now, is there any way of being able to colour this sprite? So I don't actually have to use a photo? I'm asking this because my physics object changes shape a few times and its impossible for me to keep up with the images. Basically I want to see it when SetPhysicsDebugOff()

Thanks!
This is a family-rated forum, your signature has been erased.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
THE_NOTORIOUS_PIGGY
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location:
Posted: 14th Jul 2016 06:24
That was the first thing i tried and this is what happens
http://prntscr.com/bsonpl
how can i make the whole sprite be colored?
This is a family-rated forum, your signature has been erased.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Jul 2016 07:44
As far as I know, the physics shape is not intended to be visible. It is only supposed to be a rough representation of the shape of the sprite image.

If it is just a block of colour you need as your sprite, you could use CreateColorImage when you define your sprite:

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Jul 2016 10:48

You do know you can post images in the forum? You really should as some people don't like clicking on random short links as they can contain malicious actions. (Like the infamous logout trick)

Use the image tags!!
THE_NOTORIOUS_PIGGY
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location:
Posted: 14th Jul 2016 11:07
Oh of course lmao i keep forgetting about that. anyway, I found an answer to my issue. Thank you guys for your help!



/close
( ?° ?? ?°)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Jul 2016 11:24
Quote: " I found an answer to my issue"

Care to share it for the rest of us?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Jul 2016 16:21
Sharing is what makes this forum work
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Jul 2016 19:55
Quote: " I found an answer to my issue"

What was it? Did my suggestion help?
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jul 2016 23:02
Quote: "some people don't like clicking on random short links as they can contain malicious actions. (Like the infamous logout trick)"


Is that what they were talking about in this thread?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 15th Jul 2016 10:23 Edited at: 18th Jul 2016 10:30
Quote: "Is that what they were talking about in this thread?"

That's just ******* ridiculous. Why hasn't that been patched?
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Jul 2016 18:01
Quote: "Is that what they were talking about in this thread?"

Yeah.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jul 2016 01:27
I tested the link after posting, it didn't work for me.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 19th Jul 2016 13:45
Quote: "I found an answer to my issue."
Still don't know how this was resolved.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
THE_NOTORIOUS_PIGGY
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location:
Posted: 19th Jul 2016 15:07
Oh yes, sorry i forgot cjb. basically what i did was :
size = 0

SetSpriteShapeBox(underhoop,0,size,60,20,0)

if level = 1
size = 0
endif

if level = 2
size = 100
endif

if size = 0
setspriteimage("xx.png")
else
setspriteimage("yy.png")
Wear sunscreen. — Count Dracula

Login to post a reply

Server time is: 2024-11-25 03:51:17
Your offset time is: 2024-11-25 03:51:17