Ultraschall Internals Documentation Reaper Internals Documentation Downloads Changelog of documentation Impressum and Contact
Ultraschall-logo Functions Engine GFX Engine GUI Engine Video Engine Audio Engine Doc Engine  
  Introduction/Concepts      Concepts      Concepts      Concepts      Concepts      Concepts
           Functions      Functions       Functions       Functions       Functions       Functions 

4.00Beta 2.76 - "The Police - Walking on the Moon" - 20th of July 2019 - Build: 40302

Functions Reference

Basic Shapes




Font Handling


Mouse Handling


Window Handling


Reaper version 5.95Lua version 5.3 GFX_DrawThickRoundRect


boolean retval = ultraschall.GFX_DrawThickRoundRect(integer x, integer y, integer w, integer h, number thickness, number roundness, boolean antialias)

draws a round-rectangle with a custom thickness.

You shouldn't redraw with it too often, as it eats many ressources

returns false in case of an error

 boolean retval true, drawing was successful; false, drawing wasn't successful 

 integer x the x position of the rectangle 
 integer y the y position of the rectangle 
 integer w the width of the rectangle 
 integer h the height of the rectangle 
 number thickness the thickness of the rectangle's edges 
 number roundness the angle of the rectangle's corners 
 boolean antialias true, draw antialiased; false, simply draw aliased 

Reaper version 5.95Lua version 5.3 GFX_BlitFramebuffer


boolean retval = ultraschall.GFX_BlitFramebuffer(integer framebufferidx, optional boolean showidx)

blits a framebuffer at position 0,0. If the gfx-window is smaller than the contents of the framebuffer, it will resize it before blitting to window size, retaining the correct aspect-ratio.

Mostly intended for debugging-purposes, when you want to track, if a certain framebuffer contains, what you expect it to contain.

returns false in case of an error

 boolean retval true, drawing was successful; false, drawing wasn't successful 

 integer framebufferidx the indexnumber of the framebuffer to blit; 0 to 1023; -1 is the displaying framebuffer 
 optional boolean showidx true, displays the id-number of the framebuffer in the top-left corner; false, does not display framebuffer-idx 

Reaper version 5.965Julian Sader's plugin version 0.964Lua version 5.3 GFX_Init


integer retval, HWND hwnd = ultraschall.GFX_Init(string "name", optional integer width, optional integer height, optional integer dockstate, optional integer xpos, optional integer ypos)

Opens a new graphics window and returns its HWND-windowhandler object.

 number retval 1.0, if window is opened 
 HWND hwnd the window-handler of the newly created window; can be used with JS_Window_xxx-functions of the JS-extension-plugin 

 string "name" the name of the window, which will be shown in the title of the window 
 optional integer width the width of the window; minmum is 50 
 optional integer height the height of the window; minimum is 16 
 optional integer dockstate &1=0, undocked; &1=1, docked 
 optional integer xpos x-position of the window in pixels; minimum is -80 
 optional integer ypos y-position of the window in pixels; minimum is -15 

Reaper version 5.965Lua version 5.3 GFX_GetWindowHWND


HWND hwnd = ultraschall.GFX_GetWindowHWND()

Returns the HWND of the currently opened gfx-window. You need to use ultraschall.GFX_Init(), otherwise
it will contain the message "Please, use ultraschall.GFX_Init() for window-creation, not gfx.init(!), to retrieve the HWND of the gfx-window."

 HWND hwnd the window-handler of the opened gfx-window; will contain a helpermessage, if you didn't use ultraschall.GFX_Init() for window creation.  

Reaper version 5.965Lua version 5.3 GFX_GetMouseCap


string clickstate, string specific_clickstate, integer mouse_cap, integer click_x, integer click_y, integer drag_x, integer drag_y, integer mouse_wheel, integer mouse_hwheel = ultraschall.GFX_GetMouseCap(optional integer doubleclick_wait, optional integer drag_wait)

Checks mouseclick/wheel-behavior, since last time calling this function and returns it's state.
Allows you to get click, doubleclick, dragging, including the appropriate coordinates and mousewheel-states.

Much more convenient, than fiddling around with gfx.mouse_cap

Note: After doubleclicked, this will not return mouse-clicked-states, until the mouse-button is released. So any mouse-clicks during that can be only gotten from the retval mouse_cap.
      This is to prevent automatic mouse-dragging after double-clicks.

 string clickstate "", if not clicked, "CLK" for clicked and "FirstCLK", if the click is a first-click. 
 string specific_clickstate either "" for not clicked, "CLK" for clicked, "DBLCLK" for doubleclick or "DRAG" for dragging 
 integer mouse_cap the mouse_cap, a bitfield of mouse and keyboard modifier states
   1: left mouse button
   2: right mouse button
   4: Control key
   8: Shift key
   16: Alt key
   32: Windows key
   64: middle mouse button 
 integer click_x the x position, when the mouse has been clicked the last time 
 integer click_y the y position, when the mouse has been clicked the last time 
 integer drag_x the x-position of the mouse-dragging-coordinate; is like click_x for non-dragging mousestates 
 integer drag_y the y-position of the mouse-dragging-coordinate; is like click_y for non-dragging mousestates 
 integer mouse_wheel the mouse_wheel-delta, since the last time calling this function 
 integer mouse_hwheel the mouse_horizontal-wheel-delta, since the last time calling this function 

 optional integer doubleclick_wait the timeframe, in which a second click is recognized as double-click, in defer-cycles. 30 is approximately 1 second; nil, will use 15(default) 
 optional integer drag_wait the timeframe, after which a mouseclick without moving the mouse is recognized as dragging, in defer-cycles. 30 is approximately 1 second; nil, will use 5(default) 

Reaper version 5.965Lua version 5.3 GFX_SetFont


ultraschall.GFX_SetFont(integer fontindex, string font, integer size, string flagStr)

Sets the font of the gfx-window.

As Mac and Windows have different visible font-sizes for the same font-size, this function adapts the font-size correctly(unlike Reaper's own native gfx.setfont-function).

returns false in case of an error

 integer fontindex the font-id; idx=0 for default bitmapped font, no configuration is possible for this font. idx=1..16 for a configurable font 
 string font the name of the font 
 integer size the size of the font 
 string flagStr a string, which holds the desired font-styles. You can combine multiple ones, up to 4.
The following are valid:
B - bold
i - italic
o - white outline
r - blurred
s - sharpen
u - underline
v - inverse 

Automatically generated by Ultraschall-API 4.00 Beta 2.76 - 977 functions and 6 Api-variables available