Accessing Private variables from Python?

For questions about using Classic.

Post » Sat Mar 26, 2011 2:21 pm

Is it possible to access private variables from Python?

I've been trying to get expressions like
[code:3vrx0x9k]Sprite.Value( 'privateValueName' )[/code:3vrx0x9k]
to work in python, but so far it seems like I only get back some kind of null value.
B
21
S
13
G
8
Posts: 306
Reputation: 5,458

Post » Sat Mar 26, 2011 5:17 pm

[quote:2mya6rua]Is it possible to access private variables from Python?[/quote:2mya6rua]
Yep, exactly the way you posted. If the variable name you use does not match any of the Sprite's private variables NULL will be returned.
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Sat Mar 26, 2011 11:49 pm

Okay awesome, I just built another test cap to try it out in a simpler environment and it works.

What worried me is that I had tried a simple test earlier and gotten back nothing, so I must have just done something wrong without noticing.

Thanks. :)
B
21
S
13
G
8
Posts: 306
Reputation: 5,458


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest