1 registered members (monarch),
1,259
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Round buttons
[Re: EvilSOB]
#271618
06/14/09 08:48
06/14/09 08:48
|
Joined: Mar 2004
Posts: 206 The Netherlands
Roy
OP
Member
|
OP
Member
Joined: Mar 2004
Posts: 206
The Netherlands
|
Thank you all, but i still don't really get it I don't want to slice the panel or set a different angle or anything like that. So, Jaeger, your solution sounds very nice, but i'm afraid i've never used tga's before. I figured, in paint shop pro, i can set the background to 'transparent'. But when i tried that, and used it in my code, it still doesn't work. BTW. the code i use is the following: PANEL* testpan = { button(20,20,one,one,two,null,null,null); FLAGS = SHOW; } Is that too simple, or should that just be it? Again, i don't exactly know how to use tga's. I'm using Jasc Paint Shop Pro.
|
|
|
Re: Round buttons
[Re: Roy]
#271620
06/14/09 09:00
06/14/09 09:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
If it isnt working, try inverting the transarency channel back in photoshop and try it again... That gives me headaches all the time...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Round buttons
[Re: EvilSOB]
#271629
06/14/09 09:31
06/14/09 09:31
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
User
|
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
I would put another button on top (that is exactly the same), rotate to 45 degrees, and only activate the function when both buttons are pressed. This will make the active shape an octogon instead of a square, which is very close to a circle. here's a quick photoshop showing this theory: See how they overlap? it's almost a circle. If that doesn't work, you can make up your own button function using sin and cos to make a perfect circle as the detective radius.
|
|
|
Re: Round buttons
[Re: the_mehmaster]
#271668
06/14/09 11:14
06/14/09 11:14
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
Member
|
Member
Joined: May 2009
Posts: 258
Chicago
|
Hmmm... Sorry. This actually ISN'T as easy as I made it sound. There's a trick to it. But you won't have to do a bunch of crazy stuff. I thought it was so simple because of the way I have been doing this in different projects, with my own code. But, I'm going to show you some code you can use. You'll have to give me a little while to dig through my projects and find the usable stuff. My full code is huge, so I've gotta dissect it.
Sorry to have run my mouth too quick! :P
P.S. @ the_mehmaster - As far as I know, that won't work. You can't push two buttons at once, nor have one over the other and have them both work...
Last edited by Jaeger; 06/14/09 11:15.
|
|
|
Re: Round buttons
[Re: Jaeger]
#271673
06/14/09 11:27
06/14/09 11:27
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
Member
|
Member
Joined: May 2009
Posts: 258
Chicago
|
Oh, that's how I did it... I used pixel_for_bmap to get the pixel of the button that the mouse was over, then used pixel_to_vec to see if it was over a transparent part. I copied and pasted that bit into other projects, so it seemed to me like it worked that way by default, LOL! I'll give you an example, so you can see it. It's easy... But this is straight out the manual: *Free-form buttons can be used when the button function retrieves the pixel at the mouse position through pixel_for_bmap(), and uses the pixel color or alpha value to determine whether the button was hit or not. I'll show you code asap. I'm kinda busy atm... But there's still no need to "chop up" your buttons, or use windows, etc.
Last edited by Jaeger; 06/14/09 12:16.
|
|
|
Re: Round buttons
[Re: Jaeger]
#271689
06/14/09 13:31
06/14/09 13:31
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
i was talking about the method on the Jaeger's last post, except, i just use panels and panel events for that and not the buttons.
3333333333
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|