Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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 | 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