Update on XojoScript Graphics drawing

Pushed a new update to ScriptGraphics github today that enables using clipping just like in normal Xojo code

The syntax is still API 1for now

I’m trying to see if there is an easy way for me to make it so a person can write a script like

#pragma UseApi 1 (or 2) 
// now all your drawing code using API 2

and have the scripting support just change accordingly :slight_smile:
we’ll see

1 Like

Is that a pseudocode pragma @npalardy or can you use custom pragmas??

#pragma is implemented right down in the compiler so there is no way to implement custom ones

BUT since I control the source going into the script I figured I would just use a regex to find it and set a global boolean in the script source and off we’d go :slight_smile:

unfortunately what I cannot do is use something like


     #if UseApi2
          Sub someAPI2CompliantFunction() 
          End Sub
     #end if

this doesnt work in Xojo code or Xojo script so I may end up having to handle a UseApi2 pragma as an “include” that the runtime engine deals with

that is, unless I can find something else that will work as I want - this is still under investigation

1 Like