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.1.007 - "Frank Zappa - Carolina Hard-Core Ecstasy" - 21st of October 2020 - Build: 43385

Functions Reference


Basic Shapes

GFX_DrawEmbossedSquareGFX_DrawThickRoundRect 

Blitting

GFX_BlitFramebufferGFX_BlitImageCentered 

Font Handling

GFX_SetFont  

Mouse Handling

GFX_GetMouseCap  

User Interface

Lokasenna Gui Lib v2
Lokasenna_LoadGuiLib_v2  

Window Handling

GFX_GetDropFileGFX_GetWindowHWNDGFX_Init


Ultraschall version 4.00Lua version 5.3 GFX_DrawThickRoundRect

Functioncall:

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

Description:
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

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

Parameters:
 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 


Ultraschall version 4.00Lua version 5.3 GFX_BlitFramebuffer

Functioncall:

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

Description:
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

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

Parameters:
 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 


Ultraschall version 4.00Julian Sader's plugin version 0.964Lua version 5.3 GFX_Init

Functioncall:

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

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

Returnvalues:
 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 

Parameters:
 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; nil, to center it horizontally 
 optional integer ypos y-position of the window in pixels; minimum is -15; nil, to center it vertically 


Ultraschall version 4.00Lua version 5.3 GFX_GetWindowHWND

Functioncall:

HWND hwnd = ultraschall.GFX_GetWindowHWND()

Description:
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."

Returnvalues:
 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.  



Ultraschall version 4.00Lua version 5.3 GFX_GetMouseCap

Functioncall:

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)

Description:
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.

Returnvalues:
 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 

Parameters:
 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) 


Ultraschall version 4.00Lua version 5.3 GFX_SetFont

Functioncall:

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

Description:
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


Parameters:
 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 


Ultraschall version 4.00Lua version 5.3 GFX_BlitImageCentered

Functioncall:

boolean retval = ultraschall.GFX_BlitImageCentered(integer image, integer x, integer y, number scale, number rotate, optional number srcx, optional number srcy, optional number srcw, optional number srch, optional integer destx, optional integer desty, optional integer destw, optional integer desth, optional integer rotxoffs, optional integer rotyoffs)

Description:
Blits a centered image at the position given by parameter x and y. That means, the center of the image will be at x and y.

All the rest basically works like the regular gfx.blit-function.

returns false in case of an error

Returnvalues:
 boolean retval true, blitting was successful; false, blitting was unsuccessful 

Parameters:
 integer source the source-image/framebuffer to blit; -1 to 1023; -1 for the currently displayed framebuffer. 
 integer x the x-position of the center of the image 
 integer y the y-position of the center of the image 
 number scale the scale-factor; 1, for normal size; smaller or bigger than 1 make image smaller or bigger
has no effect, when destx, desty, destw, desth are given 
 number rotation the rotation-factor; 0 to 6.28; 3.14 for 180 degrees. 
 optional number srcx the x-coordinate-offset in the source-image 
 optional number srcy the y-coordinate-offset in the source-image 
 optional number srcw the width-offset in the source-image 
 optional number srch the height-offset in the source-image 
 optional integer destx the x-coordinate of the blitting destination 
 optional integer desty the y-coordinate of the blitting destination 
 optional integer destw the width of the blitting destination; may lead to stretched images 
 optional integer desth the height of the blitting destination; may lead to stretched images 
 optional number rotxoffs influences rotation 
 optional number rotyoffs influences rotation 


Ultraschall version 4.1Lua version 5.3 GFX_GetDropFile

Functioncall:

boolean changed, integer num_dropped_files, array dropped_files, integer drop_mouseposition_x, integer drop_mouseposition_y = ultraschall.GFX_GetDropFile()

Description:
returns the files drag'n'dropped into a gfx-window, including the mouseposition within the gfx-window, where the files have been dropped.

if changed==true, then the filelist is updated, otherwise this function returns the last dropped files again.
Note: when the same files will be dropped, changed==true will also be dropped with only the mouse-position updated.
That way, dropping the same files in differen places is recognised by this function.

Call repeatedly in every defer-cycle to get the latest files and coordinates.

Important: Don't use Reaper's own gfx.dropfile while using this, as this could intefere with this function.

Returnvalues:
 boolean changed true, new files have been dropped since last time calling this function; false, no new files have been dropped  
 integer num_dropped_files the number of dropped files; -1, if no files have beend dropped at all  
 array dropped_files an array with all filenames+path of the dropped files  
 integer drop_mouseposition_x the x-mouseposition within the gfx-window, where the files have been dropped; -10000, if no files have been dropped yet  
 integer drop_mouseposition_y the y-mouseposition within the gfx-window, where the files have been dropped; -10000, if no files have been dropped yet  



Ultraschall version 4.1Lua version 5.3 Lokasenna_LoadGuiLib_v2

Functioncall:

ultraschall.Lokasenna_LoadGuiLib_v2()

Description:
loads Lokasenna's Gui Lib v2 into the current script, so you can make your own guis.

This prevents the need to use dofile, require, loadfile to load Lokasenna's Gui Lib, so you can code the actual Gui right after calling this function.

It gives you access to all classes immediately.

It uses a version of Lokasenna's Gui Lib v2 included with Ultraschall-API, so it doesn't get into conflict with other installed versions on your system.

You can find the documentation for it at this location.




Ultraschall version 4.1Lua version 5.3 GFX_DrawEmbossedSquare

Functioncall:

boolean retval = ultraschall.GFX_DrawEmbossedSquare(integer x, integer y, integer w, integer h, optional integer rgb, optional integer gbg, optional integer bbg, optional integer r, optional integer g, optional integer b)

Description:
draws an embossed rectangle, optionally with a background-color

returns false in case of an error

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

Parameters:
 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 
 optional integer rgb the red-color of the background-rectangle; set to nil for no background-color 
 optional integer gbg the green-color of the background-rectangle; set to nil for no background-color/uses rbg if gbg and bbg are set to nil 
 optional integer bbg the blue-color of the background-rectangle; set to nil for no background-color/uses rbg if gbg and bbg are set to nil 
 optional integer r the red-color of the embossed-rectangle; nil, to use 1 
 optional integer g the green-color of the embossed-rectangle; nil, to use 1 
 optional integer b the blue-color of the embossed-rectangle; nil, to use 1 



Automatically generated by Ultraschall-API 4.1 007 - 1342 functions and 6 Api-variables available