Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
update callbacks for digits #269773
06/04/09 14:21
06/04/09 14:21
Joined: Feb 2007
Posts: 353
A
amy Offline OP
Senior Member
amy  Offline OP
Senior Member
A

Joined: Feb 2007
Posts: 353
Panel digits seem to be a bit useless outside of Lite-C.

If you want to use ints or floats in C++ you can't do the necessary var conversion.

If you want to use other non-C-compatible languages you often can't pass a variable pointer at all.

My suggestion would be an update callback mechanism for digits. Instead of a var* pointer each digit(slider,...) can optionally get a function pointer. The return value of this function (which gets called every frame) sets the value the digit displays. There should also be a user data parameter which gets passed to the function.

Or maybe someone has a better idea?

Re: update callbacks for digits [Re: amy] #269936
06/05/09 09:31
06/05/09 09:31
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
This should be easy to do without a callback function. Just run a function every frame that converts your observed variable to a global var.

var digits_var = 0;

...

void convert(float fObserved)
{
digits_var = _VAR(fObserved);
}

Re: update callbacks for digits [Re: jcl] #269961
06/05/09 10:43
06/05/09 10:43
Joined: Feb 2007
Posts: 353
A
amy Offline OP
Senior Member
amy  Offline OP
Senior Member
A

Joined: Feb 2007
Posts: 353
Okay, I will try to do it like that but it's not so easy because I will have to write a lot of code which keeps track of every digit in my wrapper. I don't use C++ and don't know beforehand how many and what vars will be needed and so on...


Moderated by  aztec, Spirit 

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