Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (monarch), 1,259 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Round buttons [Re: EvilSOB] #271618
06/14/09 08:48
06/14/09 08:48
Joined: Mar 2004
Posts: 206
The Netherlands
R
Roy Offline OP
Member
Roy  Offline OP
Member
R

Joined: Mar 2004
Posts: 206
The Netherlands
Thank you all, but i still don't really get it blush
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:
Quote:
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 Offline
Expert
EvilSOB  Offline
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] #271623
06/14/09 09:18
06/14/09 09:18
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
I dont think that the mouse detects if a button is transparent or not. At least this does not work with TGA and A7, the full button image area is always detected.

When you want to detect only transparent parts, you need to read the button image and find the pixel at the mouse position. If that is transparent the button function can just return and do nothing.

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 Offline
User
the_mehmaster  Offline
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
J
Jaeger Offline
Member
Jaeger  Offline
Member
J

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
J
Jaeger Offline
Member
Jaeger  Offline
Member
J

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. smile

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 Offline
Senior Expert
Quad  Offline
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
Re: Round buttons [Re: Jaeger] #271748
06/14/09 20:29
06/14/09 20:29
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
@jaegar: sorry, i sometimes get confused between programming languages... this ended up being for blitz3d blush

Re: Round buttons [Re: the_mehmaster] #271952
06/15/09 18:39
06/15/09 18:39
Joined: Mar 2004
Posts: 206
The Netherlands
R
Roy Offline OP
Member
Roy  Offline OP
Member
R

Joined: Mar 2004
Posts: 206
The Netherlands
Thanks again.
That pixel_for_bmap method sounds good.
I guess i can something out of it, but if you could find an example, it would be very nice.


Roy

Page 2 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1