So we are porting 4 years of code from RMS Python to VEXcode V5 Python and have some API /syntax questions:
In RMS we were able to print text to brain lcd at pixel level with a printAt(x coord, y coord, opaque…) command. We used it to position labels nicely on a custom menu screen and the transparency feature was nice. We see the function defined in the API at VEX Help but can’t find it in VEXcode V5 Python.
Colors - we used to code our own colors with vex.Color.from_rgb(r, g, b) and if I recall there was a hue option as well. In VEXCode V5 Python we can only see 10 predefined colors defined by name (WHITE, RED, etc…) Is there a way to define/use custom rgb/hue colors?
create colors using RGB, for example, using the REPL.
__class__ __name__ value __bases__
__dict__ BLACK BLUE CYAN
GREEN ORANGE PURPLE RED
TRANSPARENT WHITE YELLOW hsv
is_transparent rgb web
using hsv values to modify a color
@jpearman : Thank you. Got REPL working. It’s a whole new world!!!
So if I tab I get a list of all available modules classes and functions. To get to the print_at I would do brain. then TAB then see all options, type brain.screen. then TAB etc… until I would know that brain.screen.print_at is a valid defined function. Is there a trick to find out the parameters this function needs? For example chances are slim that I would had figured out the whole syntax in its proper order - well maybe after an hour or so of trying - (“Hello”, x=10, y=90, opaque=False)? I know big Python has a module called signature or inspect or something similar.
yea, that’s an issue.
REPL is not supposed to be a help document, it just lets you play interactively with the API. VEXcode has help on many functions, but they limited what is shown in the sidebar and for some reason the VEXcode team doesn’t like the print_at function in either C++ or Python. We need better documentation, but no one has written that, for the time being just keep asking me I guess. Many of the functions follow the C++ API, but some were adjusted to make them more inline with standard Python practices.