# extRousrCore

# sr_ensure_singleton

_singleton_name {String} global name to use for the singleton
returns: {Boolean} false if an existing instance is destroyed - be sure to check CleanUp / Destroys
sr_ensure_singleton(_singleton_name)

called with object to be singleton - ensure the name passed is a singleton, will call instance destroy on a different id


# sr_ensure_font

font _font_index resource index
returns: None
sr_ensure_font(font)

cache the current font


# sr_ensure_color

_color {Real} color value to set
returns: None
sr_ensure_color(_color)

cache the current color


# sr_color_hex

color _hex_color in $RRGGBB
returns: {Real} color formatted in BBGGRR for GML
sr_color_hex(color)

Convert the RGB to BGR


# sr_color_glsl

_color {Real} color to convert
[_out_array] {Array} optional out array to not allocate a new array
returns: {Array} array of colors in float range
sr_color_glsl(_color, [_out_array])

convert a color to an array float values [0.0 - 1.0]


# sr_next_pot

_va {Real} note: if a float is given, its rounded up to 'fit' the float into the POT
returns: {Real} nearest power of 2 to given integer
sr_next_pot(_va)

return the nearest power of 2 for a given number (integer)


# sr_shadow_text

_x {Real} x position to draw text
_y {Real} y position to draw text
_text {String} text to draw
_fg {Real} foreground color
_bg {Real} background (shadow) color
[_xoff=1] {Real} x offset for the shadow
[_yoff=1] {Real} y offset for the shadow
returns: None
sr_shadow_text(_x, _y, _text, _fg, _bg, [_xoff=1], [_yoff=1])

Draw text with a shadow


# sr_outline_text

_x {Real} x position for text
_y {Real} y position for text
_text {String} text to draw
_fg {Real} foreground color
_bg {Real} background color
returns: None
sr_outline_text(_x, _y, _text, _fg, _bg)

draw text with an oultine


# sr_error

[_system] {String} system name for logging
_text {String} error message
returns: None
sr_error([_system], _text)

Error wrapper (eventual logging system)


# sr_log

[_system] {String} system name for logging
_text {String} log message
returns: None
sr_log([_system], _text)

Log wrapper (eventual logging system)


# sr_execute

_script_index {Real} script to execute
_params {Array} parameters to call, in an array
[paramCount] {Real} if you've already got the count ready, pass it, or else it's computed.
returns: {*} return value from script call
sr_execute(_script_index, _params, [paramCount])

rousr_execute - call a function with variadic argument support


# sr_aabb_contains_line

_line_x1 {Real}
_line_y1 {Real}
_line_x2 {Real}
_line_y2 {Real}
_rect_min_x {Real}
_rect_min_y {Real}
_rect_max_x {Real}
_rect_max_y {Real}
returns: {Boolean} true if an aabb and line intersect
sr_aabb_contains_line(_line_x1, _line_y1, _line_x2, _line_y2, _rect_min_x, _rect_min_y, _rect_max_x, _rect_max_y)

courtesy of https://stackoverflow.com/questions/1585525/how-to-find-the-intersection-point-between-a-line-and-a-rectangle



# extRousrDs

# sr_array

_rousr_array {Array:ERourArray} rousr_array to read / write
_index {Real} index to read or write to
[_val] {*} if passed, value to set element to, same as insert.
returns: None
sr_array(_rousr_array, _index, [_val])

return an index, or set an index in a _rousr_array


# sr_array_create

[_array] {Array} array to wrap
[_arraySize] {Real} if _arrays size is cached, pass it.
returns: None
sr_array_create([_array], [_arraySize])

create a rousr style array, with the size as the first element, and the actual array as second


# sr_array_data

_rousr_array {Array:ERousrArray} rousr_array to get the data from
returns: {Array} data in the rousr_array
sr_array_data(_rousr_array)

return the data of the rousr_array


# sr_array_destroy

_array {Array:ERourArray} array to destroy
returns: None
sr_array_destroy(_array)

destroy a rousr style array - currently does nothing, but future proofing by including.


# sr_array_find

_rousr_array {Array:ERourArray} rousr_array to search
_val {*} value to search for
[_startIndex=0] {Real} index to start searching from
returns: {Real} index or -1 if not found
sr_array_find(_rousr_array, _val, [_startIndex=0])

returns the first occurence of _val beginning at _startIndex


# sr_array_insert

_rousr_array {Array} rousr array to insert value into
_index {Real} index to insert value at
_val {*} value to insert
returns: {Boolean} true on success
sr_array_insert(_rousr_array, _index, _val)

insert a value into a rousr array


# sr_array_pop_back

_rousr_array {Array:ERourArray} rousr array to pop last value of
returns: {*} back, or undefined on failure
sr_array_pop_back(_rousr_array)

pop the back of a rousr array and return it


# sr_array_pop_front

_rousr_array {Array:ERourArray} rousr array to pop last value of
returns: {*} front or undefined
sr_array_pop_front(_rousr_array)

pop the front of an array and return it


# sr_array_push_back

_rousr_array {Array:ERourArray} _rousr_array to push data to
_val {*} value to push onto the array
returns: {Real} index pushed or -1 on error
sr_array_push_back(_rousr_array, _val)

push a value on the end of a rousr_array


# sr_array_push_front

_array {Array} rousr_array to push data to
_val {*} value to push onto the array
returns: {Real} index pushed or -1 on error
sr_array_push_front(_array, _val)

push a value on the front of a rousr array


# sr_array_push_unique

_rousr_array {Array} rousr_array to push data to
_val {*} value to push onto the array
[_returnIndexOnExists=false] {Boolean} if true returns index if it already exists, otherwise returns undefined (to signal failure)
returns: {Real} index pushed or -1 if it's not unique
sr_array_push_unique(_rousr_array, _val, [_returnIndexOnExists=false])

push a value on the end of a rousr array, but only if value isn't in the array already


# sr_array_remove

_rousr_array {Array} rousr_array to remove element at _index from
_index {Real} index to remove from _array
returns: {*} element at removed index, or undefined
sr_array_remove(_rousr_array, _index)

generate a new array with _index removed from the _rousr_array


# sr_array_remove_multi

_rousr_array {Array} rousr array to remove element at _index from
_index_array {Real} index to remove from _array (note: normal array)
[_index_array_size] {Real} size of _index_array if you've already cached it.
returns: {Array} removed values or undefined if error
sr_array_remove_multi(_rousr_array, _index_array, [_index_array_size])

generate a new array with _index removed from the _rousr_array


# sr_array_size

rousr_array _rousr_array to get the size of
[_new_size] {Real} if passed, sets the size of the array to this new size
returns: {Real} size of rousr_array (before it was set new, if _new_size is passed)
sr_array_size(`rousr_array`, [_new_size])

return the size of the rousr_array


# sr_array_clear

_rousr_array {Real} array to clear, sets size=0
[_flush_mem=false] {Boolean} if true, we will replace the data array with a new, empty array.
returns: {Array} _ra
sr_array_clear(_rousr_array, [_flush_mem=false])

emtpy a rousr_array


# sr_stack_array_create

returns: {Array} rousr_stack_array

sr_stack_array_create()

create a rousr_stack_array - a stack purely made of arrays


# sr_stack_array_destroy

_rousr_stack_array {Array} rousr_stack_array to destroy
returns: None
sr_stack_array_destroy(_rousr_stack_array)

destroy a rousr_stack_array - since they're made up of arrays, this is unnecessary to call, but provided future API use or re-using stack arrays.


# sr_stack_array_empty

_rousr_stack_array {Array} rousr_stack_array to check
returns: {Boolean} true if _rousr_stack_array is empty
sr_stack_array_empty(_rousr_stack_array)

check if a stack is empty


# sr_stack_array_pop

_rousr_stack_array {Array} rousr_stack_array array object to pop
returns: {*} the end of the stack, or undefined if empty
sr_stack_array_pop(_rousr_stack_array)

pop the last val from a _rousr_stack_array


# sr_stack_array_push

_rousr_stack_array {Array} rousr_stack_array to push _val on to
_val {*} value to push on stack
returns: {Real} new top index
sr_stack_array_push(_rousr_stack_array, _val)

push a _val onto the stack of a _rousr_stack_array


# sr_stack_array_top

_rousr_stack_array {Array} rousr_stack_array to get top index of
returns: {Real} index of top, or -1 if empty
sr_stack_array_top(_rousr_stack_array)

return the top index of a rousr_stack_array


# sr_buffer_read_val

_buffer {Real} id of buffer we're reading the next value from
returns: {Real
sr_buffer_read_val(_buffer)

Reads a value from a packed buffer, first reading data type to expect.


# sr_buffer_write_val

_buffer {Real} buffer id to write to
_val {Real
[type=ERousrData.Invalid] {Real
returns: {Boolean} true on success
sr_buffer_write_val(_buffer, _val, [type=ERousrData.Invalid])

writes a value to the buffer, but first writes the type


# sr_buffer_rousr_type_to_buffer_type

_type {Real} The ERousrData to get buffer_xx of
returns: {Real} buffer_xx to use for this type when writing to a buffer
sr_buffer_rousr_type_to_buffer_type(_type)

return a buffer type from a luarousr data type


# sr_pool_create_pool

_alloc_script {Real} script to call for a new element of this rousr_pool Format: function(_rousr_pool) -> returns {*} newly created object (the way you'd create a new one without a pool)
[_destroy_script] {Real} script to call to destroy / free the element Format: function(_rousr_pool, _elem) -> No Return
[_reset_script] {Real} script to call to reset an element after its returned to the pool Format: ``function(_rousr_pool, _elem) -> No Return`
[_constructor] {Real} script to call on returning a new element from the pool Format: function(_rousr_pool, _elem) -> No Return
returns: {Array} undefined or new rousr_pool
sr_pool_create_pool(_alloc_script, [_destroy_script], [_reset_script], [_constructor])

create a rousr_pool, using the _alloc_script to create them. use _destroy_script to remove datastructures that are pooled. rousr_pools allow you to create generic pools of similiar objects for pooling resources, rather than allocating brand new ones at run-time.


# sr_pool_destroy_pool

_rousr_pool {Array} rousr_array_pool to destroy
returns: None
sr_pool_destroy_pool(_rousr_pool)

destroy a rousr_pool and free its memory use (data structures)


# sr_pool_create

_rousr_pool {Array} the rousr_pool object to allocate new element from
[_countructor] {Real} called on the new object. if a constructor was defined for the pool, this OVERRIDES it. Format: function(_rousr_pool, _elem) -> No Return
returns: {*} a new element from the rousr_pool
sr_pool_create(_rousr_pool, [_countructor])

get a fresh item, optionally call the passed constructor on the object.


# sr_pool_release

_rousr_pool {Array} rousr_pool to put _element in.
_element {*} an _element compatible with rousr_pool
returns: None
sr_pool_release(_rousr_pool, _element)

returns element to the pool to be stored and reused


# sr_buffer_pool

_buffer_size {Real} size of the buffers to generate
_buffer_type {Real} buffer type to pass through to buffer_create i.e., buffer_u8
_buffer_alignment {Real} alignment, in bytes, of buffer
returns: {Array} rousr_pool setup to manage bufferses
sr_buffer_pool(_buffer_size, _buffer_type, _buffer_alignment)

helper function to create a rousr_pool of buffers


# __sr_buffer_pool_alloc

_rousr_pool {Array} rousr_pool that owns the created buffer
returns: {Real} buffer id for created buffer
__sr_buffer_pool_alloc(_rousr_pool)

create a new buffer


# __sr_buffer_pool_destroy

_rousr_pool {Array} rousr_pool that contains the buffer
_buffer {Real} id of a buffer
returns: None
__sr_buffer_pool_destroy(_rousr_pool, _buffer)

destroy a pooled buffer


# __sr_buffer_pool_reset

_rousr_pool {Array} pool being returned to
_buffer {Real} buffer id of buffer being returned
returns: None
__sr_buffer_pool_reset(_rousr_pool, _buffer)

reset a buffer, after being returned to the pool


# sr_json_decode

_json {String}
returns: None
sr_json_decode(_json)

false


# sr_json_encode

_sr_serializable {Real}
[_pretty_print=false] {Boolean}
Pretty TODO: print
returns: None
sr_json_encode(_sr_serializable, [_pretty_print=false], Pretty)

false


# __sr_json_encode_type

_sr_ds {Real}
_type {Real}
[_pretty_print=false] {Boolean}
[_indent_length=0] {Real}
returns: None
__sr_json_encode_type(_sr_ds, _type, [_pretty_print=false], [_indent_length=0])

false


# sr_sort_quick

list false
comparison false
returns: None
sr_sort_quick(list, comparison)

implement a quicksort you can pass a predicate to port from http://www.algolist.net/Algorithms/Sorting/Quicksort


# sr_sort_insert

list false
predicate false
returns: None
sr_sort_insert(list, predicate)

an insertion sort with a predicateported from http://www.algolist.net/Algorithms/Sorting/Insertion_sortcause why not?


# sr_ds_safe_destroy

_type {Real} type of data structure, i.e., ds_type_map, ds_type_list
_ds_id {Real} id for the datastructure
returns: {Real} undefined on success, otherwise the same id. useful for chaining calls - ds = rousr_ds_safe_destroy(type, ds);
sr_ds_safe_destroy(_type, _ds_id)

check if _ds_id is a valid _type and destroy it if it is, returning the new id to use for _ds_id (undefined in most cases)


# sr_ds_destroy

_sr_ds {Real}
returns: None
sr_ds_destroy(_sr_ds)

destroys a ds that has been created using a sr_*_create ds function.


# sr_ds_get_type

_sr_ds {Real}
returns: {Real:ERousrDS}
sr_ds_get_type(_sr_ds)

Returns the sr_ds type


# sr_ds_get_count

_sr_ds_type {Real:ERousrDS}
returns: None
sr_ds_get_count(_sr_ds_type)

returns the total count of this ds type currently in the game


# sr_list_create

returns: {Real}

sr_list_create()

Creates a new sr_list


# sr_array_to_list

_array {Array}
returns: {Array}
sr_array_to_list(_array)

converts an array to a sr_list


# sr_list_to_array

_list {Real}
returns: {Array}
sr_list_to_array(_list)

Converts a sr_list to an array


# sr_list_mark_as

_sr_list {Real}
_index {Real}
_type {ERousrDS}
returns: None
sr_list_mark_as(_sr_list, _index, _type)

Creates a nested association at given index


# sr_list_add_list

_sr_list {Real}
_child_list {Real}
returns: None
sr_list_add_list(_sr_list, _child_list)

Adds a new list to the list and creates an association


# sr_list_add_map

_sr_list {Real}
_sr_map {Real}
returns: None
sr_list_add_map(_sr_list, _sr_map)

Adds a new map to the list and creates an association


# sr_map_create

returns: {Real}

sr_map_create()

Creates a new sr_map


# sr_map_mark_as

_sr_map {Real}
_key {Real}
_type {ERousrDS}
returns: None
sr_map_mark_as(_sr_map, _key, _type)

Creates a nested association at given key


# sr_map_add_list

_sr_map {Real}
_key {*}
_sr_list {Real}
returns: None
sr_map_add_list(_sr_map, _key, _sr_list)

Sets the list to a key in the map and creates an association


# sr_map_add_map

_sr_map {Real}
_key {*}
_child {Real}
returns: None
sr_map_add_map(_sr_map, _key, _child)

Sets the child map to a key in the map and creates an association


# sr_grid_create

_cols {Real}
_rows {Real}
[_default_value=undefined] {Real}
returns: {Real}
sr_grid_create(_cols, _rows, [_default_value=undefined])

Creates a new sr_grid


# sr_grid_mark_as

_sr_grid {Real}
_x {Real}
_y {Real}
_type {Real:ERousrDS}
returns: None
sr_grid_mark_as(_sr_grid, _x, _y, _type)

Creates a nested association at given x/y coord


# sr_queue_create

returns: {Real}

sr_queue_create()

Creates a new sr_queue


# sr_priority_create

returns: {Real}

sr_priority_create()

Creates a new sr_priority


# sr_stack_create

returns: {Real}

sr_stack_create()

Creates a new sr_stack


# __sr_ds_init

returns: None

__sr_ds_init()

create internal data structures



# extRousrGeneric

# sr_generic_create

_x {Real}
_y {Real}
_depth {Real} set a layer_id afterwards if you'd prefer layers.
[_create=noone] {Real} called with(new generic) Format: function(_generic_id) -> No Return
[_generic_type=EGenericType.Normal] {Real:EGenericType} type of generic to make
returns: None
sr_generic_create(_x, _y, _depth, [_create=noone], [_generic_type=EGenericType.Normal])

create a generic object


# sr_generic_draw_self

[_id] {Real} if passed, called with(_id)
returns: None
sr_generic_draw_self([_id])

function that just calls draw_self, can be used with generics


# sr_generic_set_event

_id {Real}
_hook {Real:EGenericHook}
_event_callback {Real}
returns: None
sr_generic_set_event(_id, _hook, _event_callback)

sr_generic_event_set - set the callback for a generic event



# extRousrInput

# sr_input_system_create

returns: None

sr_input_system_create()

input_init - initialize the input data


# sr_input_bind_input

_input_type false
_input_button false
_action false
_event false
returns: None
sr_input_bind_input(_input_type, _input_button, _action, _event)

bind an input to an action


# sr_input_register_action

_action {Real} an real or string that represents the action. this key is bound to.
_action_function {Real} a script to callback _action_function(_action, _type) _type = pressed, released, down, down and pressed come in the same frame.
returns: None
sr_input_register_action(_action, _action_function)

register an action type with the input system


# sr_input_step

returns: None

sr_input_step()

step event function


# sr_input_clean_up

returns: None

sr_input_clean_up()

rousr input clean up event


# sr_input_action_active

_action {Real} index of action
returns: None
sr_input_action_active(_action)

return if an action is active


# sr_input_action_was_active

_action {Real} index of action
returns: None
sr_input_action_was_active(_action)

return if an action is active


# sr_input_check_event

_events {Array
_event_type {Real} ERousrInputEvent to find
returns: {Boolean} true if _events is or contains _event_type
sr_input_check_event(_events, _event_type)

returns true if _events is or cotnains _event_type



# extRousrUi

# sr_game_quit

returns: None

sr_game_quit()

generic callback to use for quits (button callbacks mainly)


# sr_anchor_system_init

[_ERousrAnchorSize] {Real} Type to keep anchor position matching to application surface by default
[_width] {Real} ignored unless type is Manual, width to use
[_height] {Real} ignored unless type is Manual, height to use
returns: None
sr_anchor_system_init([_ERousrAnchorSize], [_width], [_height])

initialize the RousrAnchor system


# sr_anchor_display_height

returns: {Real} display height

sr_anchor_display_height()

return the anchor instance system's display height


# sr_anchor_display_width

returns: {Real} display width

sr_anchor_display_width()

return the anchor instance system's display width


# sr_anchor_get_width

_instance {Real}
returns: {Real} anchored instance's width
sr_anchor_get_width(_instance)

helper fucntion to best guess width


# sr_anchor_get_height

_instance {Real}
returns: {Real} height of the instance
sr_anchor_get_height(_instance)

helper fucntion to best guess height


# sr_anchor_top_right

[_pad_right=0] {Real} pixels to pad on right
[_pad_top=0] {Real} pixels to pad on top
[_add_list=true] {Boolean} add it to the list to update on resize
returns: None
sr_anchor_top_right([_pad_right=0], [_pad_top=0], [_add_list=true])

snap an instance to the bottom left of the screen. Called with(instance)


# sr_anchor_bottom_left

[_pad_left=0] {Real} pixels to pad on left
**[_pad_bottom=0] ** {Real} pixels to pad on bottom
[_add_list=true] {Boolean} add it to the list to update on resize
returns: None
sr_anchor_bottom_left([_pad_left=0], [_pad_bottom=0]			, [_add_list=true])

snap an instance to the bottom left of the screen Called with(instance)


# sr_anchor_stretch_top

[_pad_left_or_sides=0] {Real} pixels to pad on left siide, or both sides if _padRight is undefined
[_pad_top=0] {Real} pixels to pad on top
[_pad_right=0] {Real} pixels to pad on the right
[_add_list=true] {Boolean} add it to the list to update on reisze
returns: None
sr_anchor_stretch_top([_pad_left_or_sides=0], [_pad_top=0], [_pad_right=0], [_add_list=true])

stretch this object acrosst the top. Called with(instance)


# sr_anchor_stretch_bottom

[_pad_left_or_sides=0] {Real} pixels to pad on left siide, or both sides if _padRight is undefined
[_pad_bottom=0] {Real} pixels to pad on top
[_pad_right=0] {Real} pixels to pad on the right
[_add_list=true] {Boolean} add it to the list to update on reisze
returns: None
sr_anchor_stretch_bottom([_pad_left_or_sides=0], [_pad_bottom=0], [_pad_right=0], [_add_list=true])

stretch this object acrosst the bottom. Called with(instance)


# sr_title_create

_title {String} title string to show
[_bg_color=0x5b6ee1] {Real} color for title text shadow
[_close_action=sr_game_quit] {Real} action to call on close button, or undefined for no close button.
[_esc_closes=true] {Boolean} escape key also calls close action
returns: None
sr_title_create(_title, [_bg_color=0x5b6ee1], [_close_action=sr_game_quit], [_esc_closes=true])

create a new rousr title


# sr_title_init

_title {String} title on titlebar
**[_fg_color=0x639bff] ** {Real} title foreground color
**[_bg_color=0x5b6ee1] ** {Real} title shadow color
[_title_font=fnt_game_3x] font {Real} to use for title
[_icon=sTitleBar_Icon] {Real} icon to show in the corner
[_bg_sprite=sTitleBar_BgStrip] {Real} sprite to use for background (must be a 1px strip)
[_close_action=sr_game_quit], close {Real} action, if undefined, then no close button
[_esc_closes=true], does {Real} escape also do the close action?
[_draw_gui=true], draw {Boolean} on the gui layer
[_scale=3] scale {Real} the title bar this much (and close button)
returns: None
sr_title_init(_title, [_fg_color=0x639bff]	, [_bg_color=0x5b6ee1]	, [_title_font=fnt_game_3x]					font, [_icon=sTitleBar_Icon], [_bg_sprite=sTitleBar_BgStrip], [_close_action=sr_game_quit],			close, [_esc_closes=true],								does, [_draw_gui=true],								draw, [_scale=3]													scale)

called after a title bar is created (Instance Create, for instance) Called with(instance)


# sr_dragger_init

(opt=noone)onDragComplete(bool) false
(opt=noone)onDragCheck false
(opt=noone)onDragBegin false
(opt=Default)draggerSlack false
returns: None
sr_dragger_init((opt=noone)onDragComplete(bool), (opt=noone)onDragCheck, (opt=noone)onDragBegin, (opt=Default)draggerSlack)

call with an object you'd like to make draggable


# sr_dragger_step

returns: None

sr_dragger_step()

call each step on a dragger


# sr_dragger_set_on_complete

_id {Real} dragger id
_on_complete {Real} Format: function({Boolean}_button_released)->No Return
returns: None
sr_dragger_set_on_complete(_id, _on_complete)

set the on complete callback after the fact


# sr_dragger_set_on_check

_id {Real} dragger id
_on_check {Real} Format: function()->No Return
returns: None
sr_dragger_set_on_check(_id, _on_check)

set the on check callback after the fact


# sr_dragger_state

_id {Real} instance id for dragger
returns: {Boolean} drag state for _id
sr_dragger_state(_id)

Conveinence function for state


# sr_dragger_is_dragging

_id {Real} _id of dragable
returns: {Boolean} true if we're dragging
sr_dragger_is_dragging(_id)

check if a draggable is dragging


# sr_dragger_sensitivity

[_dragger] {Real} dragger instance id
[_new_sensitivity=RousrDraggerDefaultSlack] {Real}
returns: None
sr_dragger_sensitivity([_dragger], [_new_sensitivity=RousrDraggerDefaultSlack])

Make it a sensitive dragger


# sr_9slice_init

new [_sprite_index=sprite_index] sprite_index
use [_use_surface=true] surface to draw
width [_width=image_xscale] of the entire frame
height [_height=image_yscale] of the entire frame
returns: None
sr_9slice_init(new, use, width, height)

initialize an instance with the appropriate fields


# sr_9slice_resize

_id {Real}
_width {Real}
_height {Real}
returns: None
sr_9slice_resize(_id, _width, _height)

helper functino to resize a frame


# sr_9slice_mark_dirty

[_id] {Real} optional, id of 9slice (or this)
returns: None
sr_9slice_mark_dirty([_id])

just a helper function so we dont need to know internals


# sr_button_create

_label {String} label to use with button
_click_action {Real} script to call when clicked Format: function(_button_instance, id, user_data) -> No Return
[_can_click=noone] {Real} script to check if this button can be clicked, besides normal button rules. Format: function(_button, _user_data) -> {Boolean} _can_click
[_depth=depth] {Real} depth to create at (just set layer afterwards if layer desired)
[_user_data] {*} passed along to click fucnction (use an id to use one button callback for multiple buttons, etc)
[_object_index=RousrButton] {Real} button object
returns: {Real} id of button or noone if not created
sr_button_create(_label, _click_action, [_can_click=noone], [_depth=depth], [_user_data], [_object_index=RousrButton])

create a new button


# sr_button_init

_click_action {Real} script to call when clicked Format: function(_button, _user_data) -> No Return
_can_click {Real} script to check if a button can be clicked Format: function(_button, _user_data) -> {Boolean} _can_click
[_user_data] {*} passed along on click
returns: None
sr_button_init(_click_action, _can_click, [_user_data])

helper function for children to init common button stuff (all optional) Called with(instance)


# sr_button_depress

returns: None

sr_button_depress()

Put a button back into the default state


# sr_button_can_click

returns: None

sr_button_can_click()

used by Button, returns whether button click is legal for buttonintended to be called with Button instance


# sr_button_wide_create

_label {String} label to use with button
_click_action {Real} script to call when clicked Format: function(_button_instance, id, user_data) -> No Return
_center_sprite {Real} index of center sprite, or left+right if those aren't included
[_left_sprite=_center_sprite] {Real} index of left sprite, or left+right if those aren't included
[_right_sprite=_center_sprite] {Real} index of right sprite, or left+right if those aren't included
[_can_click=noone] {Real} script to check if this button can be clicked, besides normal button rules. Format: function(_button, _user_data) -> {Boolean} _can_click
[_depth=depth] {Real} depth to create at (just set layer afterwards if layer desired)
[_user_data] {*} passed along to click fucnction (use an id to use one button callback for multiple buttons, etc)
returns: {Real} id of button or noone if not created
sr_button_wide_create(_label, _click_action, _center_sprite, [_left_sprite=_center_sprite], [_right_sprite=_center_sprite], [_can_click=noone], [_depth=depth], [_user_data])

create a new button


# sr_button_wide_create_ex

_label {String} label to use with button
_click_action {Real} script to call when clicked Format: function(_button_instance, id, user_data) -> No Return
_center_sprite {Real} index of center sprite, or left+right if those aren't included
[_left_sprite=_center_sprite] {Real} index of left sprite, or left+right if those aren't included
[_right_sprite=_center_sprite] {Real} index of right sprite, or left+right if those aren't included
[_center_frame=0] {Real} image_index to use for center of button (expects the 'down' version to be the next image_index)
**[_left_frame=0] ** {Real} image_index to use for left of button (expects the 'down' version to be the next image_index)
**[_right_frame=0] ** {Real} image_index to use for right of button (expects the 'down' version to be the next image_index)
[_can_click=noone] {Real} script to check if this button can be clicked, besides normal button rules. Format: function(_button, _user_data) -> {Boolean} _can_click
[_depth=depth] {Real} depth to create at (just set layer afterwards if layer desired)
[_user_data] {*} passed along to click fucnction (use an id to use one button callback for multiple buttons, etc)
returns: {Real} id of button or noone if not created
sr_button_wide_create_ex(_label, _click_action, _center_sprite, [_left_sprite=_center_sprite], [_right_sprite=_center_sprite], [_center_frame=0], [_left_frame=0]			, [_right_frame=0]			, [_can_click=noone], [_depth=depth], [_user_data])

create a new button


# sr_button_wide_set_sprites

_button_wide {Real} instance id of button wide
_center {Real} sprite_index to use for center of button
[_left=_center] {Real} sprite_index to use for left side of button
[_right=_center] sprite_index {Real} to use for right side of button
[_center_frame=0] {Real} image_index to use for center of button (expects the 'down' version to be the next image_index)
[_left_frame=0] image_index {Real} to use for left of button (expects the 'down' version to be the next image_index)
[_right_frame=0] image_index {Real} to use for right of button (expects the 'down' version to be the next image_index)
returns: {Real} _button_wide
sr_button_wide_set_sprites(_button_wide, _center, [_left=_center], [_right=_center]			`sprite_index`, [_center_frame=0], [_left_frame=0]			`image_index`, [_right_frame=0]			`image_index`)

set the sprites and frame indices for a wide button


# sr_textfield_create

[_text=""] {String} text for textfield to default to
[_depth=depth {Real} depth to create at, or the calling object's depth
[_obj=RousrTextfield] {Real} not really for you, man.
returns: {Real} _textfield_d
sr_textfield_create([_text=""], [_depth=depth, [_obj=RousrTextfield])

create a new textfield object


# sr_textfield_toggle_edit

_submit_if_done {Boolean} call on_submit if we're disabled edit
returns: None
sr_textfield_toggle_edit(_submit_if_done)

toggle edit on a textfield (memberfunction)


# sr_textfield_active

[_new_active] {Real} if passed, sets the new textfield
returns: {Real} current active textfield
sr_textfield_active([_new_active])

Return the active textfield or set a new one


# sr_date_picker_show

x false
y false
returns: None
sr_date_picker_show(x, y)

show the date picker at the given position position adjusts to screen edges


# sr_date_picker_hide

returns: None

sr_date_picker_hide()

Hide datePicker and its fields



# extRousrDrawlist

# sr_drawlist_push_line

_x1 {Real}
_y1 {Real}
_x2 {Real}
_y2 {Real}
[_color=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_line(_x1, _y1, _x2, _y2, [_color=c_white], [_alpha=1])

Pushes a line to the drawlist


# sr_drawlist_push_rectangle

_x1 {Real}
_y1 {Real}
_x2 {Real}
_y2 {Real}
[_bordered=true] {Real}
[_color=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_rectangle(_x1, _y1, _x2, _y2, [_bordered=true], [_color=c_white], [_alpha=1])

Pushes a line to the drawlist


# sr_drawlist_push_circle

_x {Real}
_y {Real}
_radius {Real}
[_bordered=false] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_circle(_x, _y, _radius, [_bordered=false], [_colour=c_white], [_alpha=1])

Pushes a circle to the drawlist


# sr_drawlist_push_text

_x {Real}
_y {Real}
_text {String}
[_font=undefined] {Real}
[_halign=undefined] {Real}
[_valign=undefined] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_text(_x, _y, _text, [_font=undefined], [_halign=undefined], [_valign=undefined], [_colour=c_white], [_alpha=1])

Pushes text to the drawlist


# sr_drawlist_push_sprite

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite(_x, _y, _sprite_index, _image_index, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_sprite_scaled

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
_image_xscale {Real}
_image_yscale {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite_scaled(_x, _y, _sprite_index, _image_index, _image_xscale, _image_yscale, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_sprite_stretched

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
_width {Real}
_height {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite_stretched(_x, _y, _sprite_index, _image_index, _width, _height, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_sprite_part

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
_source_left {Real}
_source_top {Real}
_source_width {Real}
_source_height {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite_part(_x, _y, _sprite_index, _image_index, _source_left, _source_top, _source_width, _source_height, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_sprite_part_scaled

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
_source_left {Real}
_source_top {Real}
_source_width {Real}
_source_height {Real}
_image_xscale {Real}
_image_yscale {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite_part_scaled(_x, _y, _sprite_index, _image_index, _source_left, _source_top, _source_width, _source_height, _image_xscale, _image_yscale, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_sprite_part_stretched

_x {Real}
_y {Real}
_sprite_index {Real}
_image_index {Real}
_source_left {Real}
_source_top {Real}
_source_width {Real}
_source_height {Real}
_width {Real}
_height {Real}
[_rotation=0] {Real}
[_colour=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_sprite_part_stretched(_x, _y, _sprite_index, _image_index, _source_left, _source_top, _source_width, _source_height, _width, _height, [_rotation=0], [_colour=c_white], [_alpha=1])

Pushes a sprite to the drawlist


# sr_drawlist_push_grid

_x1 {Real}
_y1 {Real}
_x2 {Real}
_y2 {Real}
_cell_size_x {Real}
_cell_size_y {Real}
[_color=c_white] {Real}
[_alpha=1] {Real}
returns: None
sr_drawlist_push_grid(_x1, _y1, _x2, _y2, _cell_size_x, _cell_size_y, [_color=c_white], [_alpha=1])

Pushes a grid to the drawlist


# sr_drawlist_pop

returns: None

sr_drawlist_pop()

Pops the last item from the drawlist


# sr_drawlist_set_depth

_depth {Real}
returns: None
sr_drawlist_set_depth(_depth)

Sets the depth of the drawlist


# sr_drawlist_draw_enable

enable {Boolean}
returns: None
sr_drawlist_draw_enable(enable)

Enables or disables drawing of the drawlist. Disable drawing and call sr_drawlist_draw to manually draw the drawlist


# sr_drawlist_draw

returns: None

sr_drawlist_draw()

Draws the drawlist. This is handled automatically at the drawlists depth unless you disabled default drawin with sr_drawlist_draw_enable