Page 1 of 1

Entity set_color method

Posted: Wed Dec 31, 2014 12:59 am
by arawra
Whenever I try calling the set_color method, I keep getting a conversion error (Python int too large for C long).

Syntax: Select all

PlayerEntity(playerIndex).set_color((255,255,255,15))

Posted: Wed Dec 31, 2014 1:26 am
by satoon101
That has been fixed in the entity_changes/entity_update branches. I think we are very close to merging those into master.

Also, I mentioned this in another thread, but it isn't fully relevant to your question. In the future, instead of passing 3/4 integer values directly, you will pass a Color instance:
http://wiki.sourcepython.com/pages/basetypes#Color

There is also a colors module which provides base colors:
http://wiki.sourcepython.com/pages/colors

To get a new alpha value for any of the base colors, use their with_alpha method:
http://wiki.sourcepython.com/pages/basetypes#with_alpha