Skip to content

Reference

Ben Levitt edited this page Nov 4, 2024 · 35 revisions

CardStock v0.99.7 Reference

Below is a full listing of the CardStock-specific variables, functions, objects, methods and events available to you in your CardStock code. Additionally, you can import other python packages and use them however you'd like, to make network connections, control other software or hardware, or perform other calculations. For more information on how to use CardStock, see the CardStock Manual in the Help menu.


Data Types Used in CardStock

These are the data types used by the properties, functions, and events in CardStock.

Type Description
bool A bool or boolean value holds a simple True or False.
int An int or integer value holds any whole number, positive or negative.
float A float or floating point value holds any number, including with a decimal point.
string A string value holds text.
list A list value is a container that holds a list of other values.
dictionary A dictionary value is a container that holds named items, as key, value pairs.
point A point value is like a list of two numbers, x and y, that describes a location in the card. For a point variable p, you can access the x value as p[0] or p.x, and the y value as either p[1] or p.y.
size A size value is like a list of two numbers, width and height, that describes the size of an object in the card. For a size variable s, you can access the width value as s[0] or s.width, and the height value as either s[1] or s.height
object An object value can hold any CardStock object, like a button, card, or oval.
stack, card, button, textfield, textlabel, webview, image, oval, rect, roundrect, polygon, line A value of any of these types holds a CardStock object of that specific type. (Note that webview objects are not currently available on cardstock.run.)

Global Variables

These global variables are available in all of your event code. There are also variables for each object on the current card. And you can access objects on other cards as, for example, stack.card_3.button_1.

Variable Type Description
card card The card is the object that represents the currently loaded card in your stack. You can access the objects on this card as card.objectName.
self object In any object's event code, self always refers to the object that contains this code.
stack stack The stack is the object that represents your whole program. You can access cards in this stack as stack.cardName.

Global Functions

These global functions are available in all of your event code.

Method Arguments Return Description
Point(x, y) x:float - The x (horizontal) part of this point.
y:float - The y (vertical) part of this point.
point Returns a point object.
Size(width, height) width:int - The width (horizontal) part of this size.
height:int - The height (vertical) part of this size.
size Returns a size object.
alert(message) message:any - Text to show in the alert dialog.
Shows an alert dialog to the user, with the message you provide, and offers an OK button.
angle_from_points(pointA, pointB) pointA:point - One location on the card.
pointB:point - Another location on the card.
float Return the angle between the bottom edge of the card, and the line from pointA to pointB, rotating clockwise. This can be useful to find the rotation angle to use to point an object at pointA towards pointB.
ask_text(message, defaultResponse) message:any - alert text to show in the dialog.
defaultResponse:any - An optional default value to pre-fill the result field.
string Shows an alert dialog to the user, with the message you provide, and a text field to enter a response, along with Ok and Cancel buttons. Returns the user-entered text in the response field if the Ok button is clicked, or None if Cancel is clicked.
ask_yes_no(message) message:any - Text to show in the dialog.
bool Shows an alert dialog to the user, with the message you provide, and offers Yes and No buttons. Returns True if Yes is clicked, and False if No is clicked.
clear_focus() If any TextField has focus, unfocus it, so that any typing will no longer be entered there.
color_hsb(hue, saturation, brightness) hue:float - The hue of the color as a number from 0.0 to 1.0, where 0 means red, and goes up through the rainbow, back to red again at 1.0.
saturation:float - The saturation of the color as a number from 0.0 to 1.0, where 0 means gray and 1 means fully saturated color.
brightness:float - The brightness component of the color as a number from 0.0 to 1.0, where 0 means black.
string Returns an HTML color string of the form '#rrggbb'. For example color_hsb(0, 1, 1) returns '#FF0000' which is bright red.
color_rgb(red, green, blue) red:float - The red component of the color as a number from 0.0 to 1.0.
green:float - The green component of the color as a number from 0.0 to 1.0.
blue:float - The blue component of the color as a number from 0.0 to 1.0.
string Returns an HTML color string of the form '#rrggbb' based on the red, green, and blue values given. For example color_rgb(1, 0, 0) returns '#FF0000' which is bright red.
distance(pointA, pointB) pointA:point - One location on the card.
pointB:point - Another location on the card.
float Return the distance between pointA and pointB.
get_mouse_pos() point Returns the current position of the mouse, whether or not it is inside of the stack window. This point's x and y values can be negative, if the mouse is to the left or below the bottom left corner of the stack window.
goto_card(card) card:(object, string, or int) - A card object, a card name, or the number of a card to go to.
Goes to the card passed in as card, the card with the name passed in as card, or the card number passed in as card. This sends the on_hide_card event for the current card, and then the on_show_card event for the new card, or does nothing if there is no card with that name or number.
goto_next_card() Goes to the next card in the stack. If we're already on the last card, then loop back to the first card. This sends the on_hide_card event for the current card, and then the on_show_card event for the new card.
goto_previous_card() Goes to the previous card in the stack. If we're already on the first card, then loop back to the last card. This sends the on_hide_card event for the current card, and then the on_show_card event for the new card.
is_key_pressed(key_name) key_name:string - The name of the key to check.
bool Returns True if the named keyboard key is currently pressed down, otherwise returns False.
is_mouse_pressed() bool Returns True if the main mouse button is currently pressed down, or the user is touching a touch screen, otherwise returns False.
is_using_touch_screen() bool Returns True if the most recent 'mouse' event came from a touch screen, otherwise returns False.
open_url(URL, in_place) URL:string - This is the URL to open.
in_place:bool - Optional parameter: When running in-browser after uploading your stack, if this is set to True, the URL will open in the current tab, instead of opening a new tab. Defaults to False.
Opens the given URL in the default browser.
play_note(note, duration, wait) note:string - The name of the note to play. Note names use the format: "Note letter", followed by an optional # for sharp, followed by an optional octave number. For example: "A", "C#", "D2", or "F#3".
duration:float - The number of seconds to play this note, or 0 to stop it.
wait:bool - Optional parameter. If set to True, this call won't return until the note is done playing. Defaults to False, returning immediately.
Starts playing the tone at the given frequency, for the given duration.
play_notes(notes, tempo, wait) notes:string - notes must be a string of note names, separated by spaces, each of the format "Note letter" optionally followed by a "#" and optional octave number 1-6. Each note name can also be followed by an optional note length after a "/" character. For example: "A3/8 C#3/2" would play an eighth note at A3 followed by a half note at C#3. To include a rest, use the non-note name "R", for example "R/4" for a quarter note rest. Notes are quarter notes by default.
tempo:float - The tempo to play back these notes, in beats per minute, assuming each half note is one beat.
wait:bool - Optional parameter. If set to True, this call won't return until the notes are done playing. Defaults to False, returning immediately.
Starts playing the string of notes, at the given tempo.
play_sound(file, wait) file:string - This is the filename of the .wav format audio file to play, relative to where the stack file lives.
wait:bool - Optional parameter. If set to True, this call won't return until the sound is done playing. Defaults to False, returning immediately.
Starts playing the .wav formatted sound file at location file.
play_tone(frequency, duration, wait) frequency:float - The frequency of the tone to play in Hz.
duration:float - The number of seconds to play this tone, or 0 to stop it.
wait:bool - Optional parameter. If set to True, this call won't return until the tone is done playing. Defaults to False, returning immediately.
Starts playing the tone at the given frequency, for the given duration.
quit() Stops running the stack, closes the stack window, and exits the stack viewer program.
request_url(URL, params, headers, method, timeout, on_done) URL:string - This is the URL to request.
params:dictionary - This optionally holds query parameters for your request.
headers:dictionary - This optionally holds HTTP headers for your request.
method:string - This optionally holds an HTTP method name like "GET" or "POST". Requests default to "GET".
timeout:float - This optionally allows setting a timeout in seconds, after which the request will be cancelled.
on_done:function - This optional function is called when the request has received a response. This callback function receives 2 arguments: an HTTP status code as an int, and the response as a string, or as binary data if the response is not text.
Requests the given URL. If an on_done function is provided, this request_url() function will return immediately, and when the response is received, the given on_done(status, result) function will run. If no on_done function is provided, this request_url() will wait until it gets a response, and will return the response data as text or binary data. Optional headers and query params can be provided as dictionaries, and method and timeout can be provided as well, if needed.

Examples:

# Request the text from a URL and wait until we get it back
htmlString = request_url("https://google.com/")

# Request the text from a URL without waiting. got_result() is called when it's ready.
def got_result(status, text):
    if status == 200:
        print(text)
request_url("https://google.com/", on_done=got_result)

# Request the text from a URL, with parameters, and wait until we get it back
jokeJson = request_url("https://geek-jokes.sameerkumar.website/api", params={"format": "json"})
rotate_point(point, angle) point:point - A distance in x and y, from (0,0).
angle:float - An angle in degrees to rotate the point around (0,0).
point Returns a new point, calculated by rotating point by angle degrees, clockwise around the point (0,0). This is useful to, for example, set the speed of a cannonball that should be moving in the direction that a cannon is already pointing.
run_after_delay(duration, func) duration:float - Number of seconds to delay.
func:function - A function to call after the delay.
This function lets your program continue running while a timer waits for duration seconds, and then runs the functions func, passing it any additional arguments you add after func. Movements, animations, and user interaction will all continue during this time.
run_stack(filename, cardNumber, setupValue) filename:string - The path to a stack file to run. On cardstock.run, a filename can be a stack name owned by the same user as the current stack, or a full path "username/StackName", like "examples/Pong".
cardNumber:int - An optional card number of the new stack to start on. This defaults to card number 1, the first card.
setupValue:any - An optional value to pass into the new stack.
any Opens the stack at the path given by the filename argument. Optionally starts on the card number specified by the cardNumber argument. If you include a setupValue argument, this will be passed into the new stack, which can access it by calling stack.get_setup_value(). The run_stack() call waits until the new stack exits by calling stack.return_from_stack(returnVal), and then this run_stack() call returns that returnVal value, or None if no returnValue was given.
stop_sound() Stops all currently playing sounds.
time() float Returns the time in seconds since 'The Unix Epoch', midnight UTC on January 1st, 1970. That date doesn't usually matter, since most often, you'll store the time at one point in your program, and then compare it to the new time somewhere else, to determine the difference.
wait(duration) duration:float - Number of seconds to delay.
Delays the program from running for duration seconds. Object animations that are already in progress or queued up will continue during this time.

All Objects

Many properties, methods, and events apply to objects of all types, so we'll list those all here just once. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
center point The center property is a point value that describes where on the card this object's center point is. The first number, x, is how many pixels the object's center is from the left edge of the card. The second number, y, is how far up from the bottom. This value is not stored, but computed based on position and size.
children list children is the list of objects that this object contains. A stack has children that are cards. A card and a group can both have children objects. Other objects have no children.
data dictionary Every object has a data property. It is a dictionary that allows you to persistently store arbitrary data in any object within a stack that has can_save set to True.
is_visible bool True if this object is_visible, or False if it is hidden. If this object is in a group that has been hidden, this object's is_visible property will be False as well.
name string Every object has a name property. These are forced to be unique within each card, since these become the names of your object variables that you access from your code. From your code, you can get an object's name, but you can not set it.
parent object parent is the object that contains this object. For most objects, it is the card, unless this object has been grouped, in which case its parent is the group object A card's parent is the stack. The stack has no parent, so stack.parent is None.
position point The position property is a point value that describes where on the card this object's bottom-left corner is. The first number, x, is how many pixels the object is from the left edge of the card. The second number, y, is how far up from the bottom.
rotation float This is the angle in degrees clockwise to rotate this object around its center. 0 is normal/upright. Note that not all objects can be rotated, for example cards and stacks.
size size The size property is a size value that describes how big this object is on screen. The first number, width, is how wide the object is, and the second number, height, is how tall.
speed point This is a point value corresponding to the current speed of the object, in pixels/second in both the x and y directions.
type string Every object has a type property. It will be one of 'button', 'textfield', 'textlabel', 'webview', 'image', 'line', 'oval', 'rect, 'roundrect', 'polygon', 'stack', 'card', 'group'. Your code can get this value, but not set it. (Note that webview objects are not currently available on cardstock.run.)

Methods

Method Arguments Return Description
animate_center(duration, end_position, easing, on_finished) duration:float - time in seconds for the animation to run
end_position:point - the destination center position at the end of the animation, as a 2-item list representing an x and y location, like (100,140).
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes
Visually animates the movement of this object from its current position to have its center at end_center, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_position(duration, end_position, easing, on_finished) duration:float - time in seconds for the animation to run
end_position:point - the destination bottom-left corner position at the end of the animation, as a 2-item list representing an x and y location, like (100,140).
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates the movement of this object from its current position to end_position, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_rotation(duration, end_rotation, force_direction, easing, on_finished) duration:float - time in seconds to run the animation
end_rotation:int - the final rotation angle in degrees clockwise at the end of the animation
force_direction:int - an optional hint to tell CardStock which direction you want the object to rotate. A positive value forces clockwise rotation, and a negative value forces counter-clockwise.
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's rotation angle to end_rotation, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_size(duration, end_size, easing, on_finished) duration:float - time in seconds for the animation to run
end_size:size - the final size of this object at the end of the animation, as a 2-item list representing the width, and height, like (100,50).
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes
Visually animates the size of this object from its current size to end_size, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
child_with_base_name(baseName) baseName:string - The beginning of the name of the child object to find.
object Returns this object's first child object whose name starts with baseName. For example, if you have multiple group objects that each contain one button, named button_1, button_2, etc.,then you can call each group's group.child_with_base_name('button') to get that group's button object.
clone(...) ...:Any - optionally set more properties here. For example, include position=(10,10)
object Duplicates this object, and updates the new object's name to be unique, and then returns the new object for you to store into a variable.
delete() Deletes this object.
flip_horizontal() Flips the object horizontally. This only visibly changes cards, images, groups, and some shapes.
flip_vertical() Flips the object vertically. This only visibly changes cards, images, groups, and some shapes.
get_code_for_event(eventName) eventName:string - The name of the event to look up.
string Returns a string containing this object's event code for the given eventName. For example, button_1.get_code_for_event('on_click') will return the code in the object named button_1 for the 'on_click' event.
hide() Hides this object if it was visible.
is_touching(other) other:object - The other object to compare to this one
bool Returns True if this object is touching the other object passed into this function, otherwise returns False.
is_touching_edge(other) other:object - The other object to compare to this one
list Returns an empty list if this object is not touching any edges of the other object passed into this function. If this object is touching any edges of the other object, the return value will be a list including one or more of the strings: 'Top', 'Bottom', 'Left', or 'Right', accordingly.
is_touching_point(point) point:point - Checks whether this point is inside the object.
bool Returns True if this object is touching the point passed into this function, otherwise returns False.
order_backward() Moves this object one position closer to the back of the card or group it is contained in.
order_forward() Moves this object one position closer to the front of the card or group it is contained in.
order_to_back() Moves this object to the back of the card or group it is contained in, behind all other objects.
order_to_front() Moves this object to the front of the card or group it is contained in, in front of all other objects.
order_to_index(toIndex) toIndex:int - The index to move this object to, in the list of the card or group's children. Index 0 is at the back.
Moves this object to the given index, in the list of its parent's children, with 0 being at the back.
send_message(message) message:string - The message being sent to this object.
Sends a message to this object, that the object can handle in its on_message event code. For example, you could send the message 'reset' to an object, and in its on_message code, it could check for whether message == 'reset', and then set some variables back to their initial values.
set_bounce_objects(objects) objects:list - A list of objects that this object should bounce off of
Sets up this object so that it will automatically bounce off of the given objects, if it intersects with an edge of any of the objects in the list, while this object's speed is non-zero. When an object bounces, its on_bounce() event will run.
set_code_for_event(eventName, code) eventName:string - The name of the event to set.
code:string - The code to run on this event.
Sets the code to be run when the event named eventName triggers for this object. For example, button_1.set_code_for_event('on_click', 'alert("Hello")') will set up button_1 to show an alert when clicked.
show() Shows this object if it was not visible.
stop_animating(property_name) property_name:string - optional name of the property to stop animating, for example: "size" or "position". If left blank, stops all animations of properties of this object.
Stops the animation specified by property_name from running on this object, or if no property_name is specified, stops all running animations on this object. Any animated properties are left at their current, mid-animation values.
stop_handling_mouse_event() If you call this method from your event code for any on_mouse_press(), on_mouse_move(), or on_mouse_release() event, CardStock will skip running code for this event for any overlapping objects underneath this object, which would otherwise be run immediately after this object's event code finishes. Calling this method from any non-mouse event code does nothing. Should be run as self.stop_handling_mouse_event().

Events

Event Arguments Description
on_bounce(self, other_object, edge): other_object:object - The other object that this object just bounced off of.
edge:string - The edge of the other object that we just bounced off of ('Left', 'Right', 'Top', or 'Bottom').
The on_bounce event is run whenever this object collides with an object that it knows to bounce off of. Set up the list of objects that this object will bounce off of by calling object.set_bounce_objects(list) with that list of objects. For example, if you have called ball.set_bounce_objects([card]), then the ball object will bounce off of the edges of the card. And when the ball touches the top of the card, ball.speed.y will flip from positive to negative, so that the ball will start moving downwards, and the on_bounce(other_object, edge) event will run with other_object=card and edge='Top'.
on_message(self, message): message:string - This is the message string that was passed into a send_message() or broadcast_message() call.
The on_message event is run when broadcast_message() is called, or send_message() is called on this object. The message string passed into send_message() or broadcast_message() is delivered here.
on_mouse_enter(self, mouse_pos): mouse_pos:point - This is the current position of the mouse pointer on the card.
The on_mouse_enter event is run when the mouse pointer moves onto this object.
on_mouse_exit(self, mouse_pos): mouse_pos:point - This is the current position of the mouse pointer on the card.
The on_mouse_exit event is run when the mouse pointer moves back off of this object.
on_mouse_move(self, mouse_pos): mouse_pos:point - This is the current position of the mouse pointer on the card.
The on_mouse_move event is run every time the mouse moves, while over this object, whether or not the mouse button is down, and gives you the current mouse position as the point mouse_pos. This event will be run for all objects underneath the mouse pointer, from the topmost object, down to the card itself, unless this propagation is stopped by calling self.stop_handling_mouse_event() from your code. Note that Mouse events are run whether you use a mouse, trackpad, touchscreen, or any other pointing device.
on_mouse_press(self, mouse_pos): mouse_pos:point - This is the current position of the mouse pointer on the card.
The on_mouse_press event is run when the mouse button gets pressed down inside of this object, and gives you the current mouse position as the point mouse_pos. This event will be run for all objects underneath the mouse pointer, from the topmost object, down to the card itself, unless this propagation is stopped by calling self.stop_handling_mouse_event() from your code. Note that Mouse events are run whether you use a mouse, trackpad, touchscreen, or any other pointing device.
on_mouse_release(self, mouse_pos): mouse_pos:point - This is the current position of the mouse pointer on the card.
The on_mouse_release event is run when the mouse button is released over this object, and gives you the current mouse position as the point mouse_pos. This event will be run for all objects underneath the mouse pointer, from the topmost object, down to the card itself, unless this propagation is stopped by calling self.stop_handling_mouse_event() from your code. Note that Mouse events are run whether you use a mouse, trackpad, touchscreen, or any other pointing device.
on_periodic(self, elapsed_time): elapsed_time:float - This is the number of seconds since the last time this event was run, normally about 0.03.
The on_periodic event is run approximately 30 times per second on every object on the current page, and gives your object a chance to run periodic checks, for example checking for collisions using is_touching().
on_setup(self): The on_setup event is run once for every object in your stack, immediately when the stack starts running, before showing the first card. This is a great place to run any imports that your program needs, and to define functions, and set up any variables with their initial values.

Stack

The stack object represents your whole CardStock program. You can always access the stack as the global variable stack. And you can access any of the stack's cards as stack.cardName.

Properties

Property Type Description
can_save bool If can_save is True, the user can save the stack while running it. If it's False, the user can't save, so the stack will always start out in the same state. (Not currently supported on cardstock.run.)
current_card object This is the card object that is currently visible. stack.current_card.number will give you the number of the current card.
info string You can enter info about your stack here, for example, instructions, explanation, a Change Log, License information, etc. This info is accessible from your code, but not settable. It's also viewable to anyone running this stack via the [Info] button when running on cardstock.run, or via the Stack Info menu item when running in the desktop app.
num_cards int This is the number of cards in this stack. You can read this value, but not set it.

Methods

Method Arguments Return Description
add_card(name, atNumber) name:string - an optional argument giving the name to use for this new card object. If omitted, the name will be 'card_{N}'.
atNumber:int - an optional argument giving the card number in the stack where the card should be added. Number 1 is at the beginning. If omitted, the card will be added at the end of the stack.
card Adds a new empty card to the stack, and returns the card object.
broadcast_message(message) message:string - This is the message to send.
Sends the message to all objects on this card, or to all objects on all cards if called on the stack, causing each of the objects' on_message events to run with this message.
card_with_number(number) number:int - the card number of the card to get.
card Returns the card at card number. The first card is number 1.
get_setup_value() If this stack was started by another stack calling run_stack() with a setupValue argument, you can call this get_setup_value() method to get the setupValue that was passed in from the calling stack. Otherwise this will return None.
return_from_stack(returnValue) returnValue:any - An optional value to pass back to the previous stack, that we are returning to.
If this stack was started from within another stack, by calling run_stack(), this function will immediately stop the current event without returning, exit this stack, and return to the previous stack. If you include a returnValue, this value will be returned by the calling stack's run_stack() call, which will now finally return. If the current stack was not started by a run_stack() call, this function does nothing, and returns normally.
show_info() Shows the stack's info property.

Events

Event Arguments Description
on_exit_stack(self): The on_exit_stack event is run when the stack exits, whether from the File Close menu item, the quit() function, the stack.return_from_stack() method, or closing the running stack window. You can use this to clean up any external resources -- for example, closing files. This event needs to run quickly, so it's not able to call functions like alert(), ask_text(), ask_yes_no(), run_stack(), etc.

Card

Cards are the pages of your stack. Each card has its own set of objects, andits own code for handling events. The below properties, methods, and events, in addition to those in the All Objects section, apply to card objects. Access an object's properties or methods as, for example, object_name.size or object_name.show(). You can also access a child object of this card as card.object_name.

Properties

Property Type Description
can_resize bool If can_resize is True, then when running, the card will automatically adjust its size to fill the browser window on cardstock.run, or on desktop, will allow the user to manually resize the window.
fill_color string The fill_color is used to fill in a shape, or the background of a card. This can be a color word like white, or an HTML color like #EEEEEE for a light grey.
number int This is the card number of this card. The first card is number 1. You can read this value, but not set it.

Methods

Method Arguments Return Description
add_button(...) ...:Any - optionally set any of the new object's properties here. For example: name="thingy", position=(20,200), size=(100,50)
button Adds a new Button to the card, and returns the new object.
add_group(objects, ...) objects:list - a list of object, all on the same card, to include in the new group object.
...:Any - optionally set more properties here. For example: name="bundle"
group Adds a new Group to the card, and returns the new object.
add_image(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
image Adds a new Image to the card, and returns the new object.
add_line(points, ...) points:list - a list of points, that are the locations of each vertex along the line, relative to the bottom-left corner of the card. It can hold just two points to create a simple line segment, or more to create a more complex multi-segment line.
...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
line Adds a new Line to the card, and returns the new object.
add_oval(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
oval Adds a new Image to the card, and returns the new object.
add_polygon(points, ...) points:list - a list of points, that are the locations of each vertex along the outline of the polygon, relative to the bottom-left corner of the card. It must hold three or more points to display properly as a polygon.
...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
polygon Adds a new Polygon shape to the card, and returns the new object.
add_rectangle(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
rect Adds a new Rectangle to the card, and returns the new object.
add_round_rectangle(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
roundrect Adds a new Round Rectangle to the card, and returns the new object.
add_text_field(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
textfield Adds a new Text Field to the card, and returns the new object.
add_text_label(...) ...:Any - optionally set more properties here. For example: name="thingy", position=(20,200), size=(100,50)
textlabel Adds a new Text Label object to the card, and returns the new object.
animate_fill_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final fill_color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates this card's fill_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
broadcast_message(message) message:string - This is the message to send.
Sends the message to all objects on this card, or to all objects on all cards if called on the stack, causing each of the objects' on_message events to run with this message.
stop_all_animating(property_name) property_name:string - optional name of the property to stop animating, for example: "size" or "position". If left blank, stops animations of all properties of this card and its children.
Stops the animation specified by property_name from running on this card and on all objects on this card, or if no property_name is specified, stops all running animations on this card and on all objects on this card. Any animated properties are left at their current, mid-animation values.

Events

Event Arguments Description
on_hide_card(self): The on_hide_card event is run when a card is hidden, right before the new card's on_show_card event is run, when going to another card.
on_key_hold(self, key_name, elapsed_time): key_name:string - The name of the key that is still being held down
elapsed_time:float - This is the number of seconds since the key press started, or since the last time this event was run, normally about 0.03.
The on_key_hold event is run repeatedly, while any keyboard key is pressed down. Regular keys are named as capital letters and digits, like 'A' or '1', and other keys have keyNames like 'Shift', 'Return', 'Escape', 'Left', and 'Right'.
on_key_press(self, key_name): key_name:string - The name of the pressed key
The on_key_press event is run any time a keyboard key is pressed down. Regular keys are named as capital letters and digits, like 'A' or '1', and other keys have keyNames like 'Shift', 'Return', 'Escape', 'Left', and 'Right'.
on_key_release(self, key_name): key_name:string - The name of the released key
The on_key_release event is run any time a pressed keyboard key is released. Regular keys are named as capital letters and digits, like 'A' or '1', and other keys have keyNames like 'Shift', 'Return', 'Escape', 'Left', and 'Right'.
on_resize(self, is_initial): is_initial:bool - True if this event is running due to showing the card. False if this event is running due to the card being resized.
The on_resize event is run on the currently visible card when the stack window is resized. It is also run each time a card is shown, to give the card a chance to set up its initial layout for the current size. Your code can distinguish between these two cases by checking the value of is_initial.
on_show_card(self): The on_show_card event is run any time a card is shown, including when the first card is initially shown when the stack starts running.

Button

Buttons in CardStock come in 4 styles. Border style buttons show their text centered inside of a rounded rectangle border, and when clicked, run their on_click() event code. Borderless buttons behave the same, but are transparent and do not display a border. A Checkbox button shows its text left-justified, after a checkbox that shows a check when it is selected. When a user clicks a Checkbox, its selection state toggles between selected and not,and the object's on_selection_changed() event is run. A Radio button shows its text left-justified, after an indicator circle, that shows a dot inside when it is selected. When a user clicks a Radio button, it is selected, and any other Radio buttons in the same Radio group are deselected, and both objects' on_selection_changed() events is run, first the deselection, and then the selection. All Radio buttons directly on the card are in one Radio group. All Radio buttons that have been grouped together into the same Group object are in their own Radio group. The below properties, methods, and events, in addition to those in the All Objects section, apply to button objects. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
fill_color string For buttons with a border, set the button's background color.
is_pressed bool This is True while the button is actively being pressed by the mouse / touch screen.
is_selected bool For Border and Borderless style buttons, this is always False. For Checkbox style buttons, this is True when the Checkbox is checked. For Radio buttons, this is True when this Radio button is the selected button in its group.
style [Border, Borderless, Checkbox, Radio] Buttons with style Border show a rounded rectangular border, depending on your computer's operating system. This is the most commonly seen style of button. The Borderless style behaves the same, but is drawn without a border.You can also set style to be Checkbox, which allows users to alternately select and deselect this button, and it is drawn with a checkbox to show the selection state. You can set the style to Radio, which allows selecting only one button at a time from a group of Radio buttons, and is drawn with a round selection indicator. All Radio buttons with the same immediate parent (the Card, or a Group) are considered to be in the same Radio button group, and selecting any of these will automatically deselect all of the rest in the group.
text string The text property holds the text content of this button, text label, or text field.
text_color string Set this button's text color.

Methods

Method Arguments Return Description
click() Runs this button's on_click event code.
get_radio_group() list If this button is a Radio button, then return a list of all Radio buttons in this button's Radio group, which is defined as all Radio buttons with the same direct parent (Card or Group). Otherwise returns an empty list.
get_radio_group_selection() button If this button is a Radio button, then return the selected Radio button in this button's Radio group. If this button is not a Radio button, or if none of the buttons in the group are selected, returns None.

Events

Event Arguments Description
on_click(self): The on_click event is run when a user clicks down on this button, and releases the mouse, while still inside the button. It is also run when the button's click() method is called.
on_selection_changed(self, is_selected): is_selected:bool - The new selection state of this button. True if this button was just selected, otherwise False.
Used by Checkbox and Radio style buttons only, the on_selection_changed event is run when a user selects or deselects this button. When a Radio button is selected, this event will be run first for any previously selected Radio button, with is_selected = False to deselect the old choice, and then for this newly selected Radio button with is_selected = True.

Text Field

Text fields are object where your stack's users can enter or edit text. The below properties, methods, and events, in addition to those in the All Objects section, apply to text field objects. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
alignment [Left, Center, Right] By default, text labels and text fields start aligned to the left, but you can change this property to make your text centered, or aligned to the right.
font [Default, Serif, Sans-Serif, Mono] The font used for the text in this label or field.
font_size int The point size for the font used for the text in this label or field.
has_focus bool True if this TextField is focused (if it is selected for typing into), otherwise False. This value is not settable, but you can call the method focus() to try to focus this Field.
is_bold bool Set to True if this object's text is bold.
is_editable bool By default text fields can be edited by the user. But you can set this to False so that the text can not be edited.
is_italic bool Set to True if this object's text is italic.
is_multiline bool By default, text fields hold only one line of text. But you can set the is_multiline property to True to let them hold multiple lines of text.
selected_text string A text field's selected_text value is the string that is currently selected within the field's text. For example, if the text is 'Hello', and the 'He' is selected, then the selected_text value would be 'He'.
selection list A text field's selection value is a list of 2 numbers. The first is the start index of the selection within the field's text, and the second is the index of the end of the selection. For example, if the text is 'Hello', and the 'He' is selected, then the value of selection would be (0, 2).
text string The text property holds the text content of this button, text label, or text field.
text_color string The color used for the text in this text label or text field. This can be a color word like red, or an HTML color like #333333 for dark gray.

Methods

Method Arguments Return Description
animate_font_size(duration, end_size, easing, on_finished) duration:float - time in seconds for the animation to run
end_size:string - the final font_size at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's font_size to end_size, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_text_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final text_color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's text_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
enter() Runs this text field's on_text_enter event code.
focus() Selects this TextField so that it will handle key presses. Typed words will get entered into the currently focused TextField.
index_to_point(index) index:int - an index, or character position within the text of this field. For example, 0 is the first character.
point Returns the point on the card that lines up with the start of the character at the given index within this field's text.
index_to_row_col(index) index:int - an index, or character position within the text of this field. For example, 0 is the first character.
int Converts from an text position index to a row (line number) and column (character within the row) pair. Returns a list of two integers, giving the row and column, respectively, of the character at the given index in this field's text. For example field.index_to_row_col(0) would return (0, 0) to indicate the first character on the first line.
point_to_index(point) point:point - a point relative to the bottom-left corner of the current card
int Returns the index, or character position, of the character at the given point on the card. The first character in the field is at index 0.
row_col_to_index(row, col) row:int - the row, or line number of the target character. 0 indicates the first line.
col:int - the column, or character position on the given row, of the target character. 0 indicates the first character on a line.
int Converts from a row and column position to a character index. Returns the index of the character at the given row and column within this field's text.
select_all() Selects all text in this text field.

Events

Event Arguments Description
on_text_changed(self): The on_text_changed event is run every time the user makes any change to the text in this text field.
on_text_enter(self): The on_text_enter event is run when the user types the Enter key in this text field.

Text Label

Text labels are objects that show text on the card, but are not editable by users. The below properties, methods, and events, in addition to those in the All Objects section, apply to text labels. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
alignment [Left, Center, Right] By default, text labels and text fields start aligned to the left, but you can change this property to make your text centered, or aligned to the right.
can_auto_shrink bool When the can_auto_shrink property is True, the font_size of the text in this label will shrink if needed, to fit into the label object's current size.
font [Default, Serif, Sans-Serif, Mono] The font used for the text in this label or field.
font_size int The point size for the font used for the text in this label or field.
is_bold bool Set to True if this object's text is bold.
is_italic bool Set to True if this object's text is italic.
is_underlined bool Set to True if this object's text is underlined.
text string The text property holds the text content of this button, text label, or text field.
text_color string The color used for the text in this text label or text field. This can be a color word like red, or an HTML color like #333333 for dark gray.

Methods

Method Arguments Return Description
animate_font_size(duration, end_size, easing, on_finished) duration:float - time in seconds for the animation to run
end_size:string - the final font_size at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's font_size to end_size, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_text_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final text_color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's text_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.

Events

No additional events for this object type.


Web View

Web views are objects that let you load web pages into your stacks. The below properties, methods, and events, in addition to those in the All Objects section, apply to web view objects. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
HTML string This is the current HTML content of the webview.
URL string This is the current URL being shown by the Web View. Set this property to go to a web page.
allowed_hosts list If the allowed_hosts list is empty, then this WebView will be allowed to load any URL. If this list contains hostnames like 'google.com', then the WebView will only be allowed to load URLs from these web hosts, and attempts to load other URLs, either by setting the URL property directly, or by clicking a link, will fail.
can_go_back bool This is True if the webview has pages in its history to go back to, otherwise it is False. This value can be read but not set.
can_go_forward bool This is True if the webview has gone back, and has history pages available to go forward to, otherwise it is False. This value can be read but not set.

Methods

Method Arguments Return Description
go_back() Make the WebView go back through its history list.
go_forward() Make the WebView go forward through its history list.
run_java_script(code) code:string - The JavaScript code to run in this Web View
string Runs the given JavaScript code and returns any result.

Events

Event Arguments Description
on_card_stock_link(self, message): message:string - This is the message part of a 'cardstock:message' URL.
The on_card_stock_link event is run whenever a web page tries to load a URL of the form cardstock:message. You can add code in this event to respond to actions in a web page that call a cardstock: URL.
on_done_loading(self, URL, did_load): URL:string - This is the URL of the web page that just loaded.
did_load:bool - True if the URL loaded successfully, otherwise False.
The on_done_loading event is run whenever a web page finishes loading.

Image

Image objects show an image from an image file. The below properties, methods, and events, in addition to those in the All Objects section, apply to image objects. Access an object's properties or methods as, for example, object_name.size or object_name.show()

Properties

Property Type Description
file string The file path of the image file to display in this image object.
fit [Center, Stretch, Contain, Fill] This property controls how the image is resized to fit into the image object. Center shows the image full size, centered in the image object, and clipped at the image object border. Stretch resizes and stretches the image to fit exactly into the image object. Contain sizes the image to fit inside the image object, while keeping the original image aspect ratio. Fill sizes the image to just barely fill the entire image object, while keeping the original image aspect ratio.

Methods

No additional methods for this object type.

Events

No additional events for this object type.


Shape - Line and Pen

A line shape is a straight line connecting two points. A pen shape is whatever shape you draw out with the pen tool. Both have a pen_color and a pen_thickness. The below properties and methods, in addition to everything in the All Objects section, apply to these shape objects.

Properties

Property Type Description
pen_color string The color used for the line or shape border. This can be a color word like red, or an HTML color like #FF0000 for pure red.
pen_style [Solid, Long-Dashes, Dashes, Dots] The pen style of this line or shape border.
pen_thickness int The thickness of the line or shape border in pixels.
points list This is the list of points that define this line, pen, or polygon object. The other shape types do not provide access to this list.

Methods

Method Arguments Return Description
animate_pen_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final pen color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's pen_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_pen_thickness(duration, end_thickness, easing, on_finished) duration:float - time in seconds for the animation to run
end_thickness:int - the final pen_thickness at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's pen_thickness to end_thickness, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.

Events

No additional events for this object type.


Shape - Oval, Rectangle, and Polygon

Oval rectangle, and polygon shapes have a pen_color and pen_thickness like Line and Pen objects, but also have a fill_color. The below properties, methods, and events, in addition to those in the All Objects section, apply to these shape objects.

Properties

Property Type Description
fill_color string The color used to fill in a shape, or the background of a card. This can be a color word like red, or an HTML color like #FF0000 for pure red.
pen_color string The color used for the line or shape border. This can be a color word like red, or an HTML color like #FF0000 for pure red.
pen_style [Solid, Long-Dashes, Dashes, Dots] The pen style of this line or shape border.
pen_thickness int The thickness of the line or shape border in pixels.
points list This is the list of points that define this line, pen, or polygon object. The other shape types do not provide access to this list.

Methods

Method Arguments Return Description
animate_fill_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final fill_color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's fill_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_pen_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final pen color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's pen_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_pen_thickness(duration, end_thickness, easing, on_finished) duration:float - time in seconds for the animation to run
end_thickness:int - the final pen_thickness at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's pen_thickness to end_thickness, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.

Events

No additional events for this object type.


Shape - Round Rectangle

A round rectangle shape has a Rectangle shape's properties, and additionally has a corner_radius. The below properties and methods, in addition to everything in the All Objects section, apply to these shape objects.

Properties

Property Type Description
corner_radius int The radius used to draw this round rectangle's rounded corners.
fill_color string The color used to fill in a shape, or the background of a card. This can be a color word like red, or an HTML color like #FF0000 for pure red.
pen_color string The color used for the line or shape border. This can be a color word like red, or an HTML color like #FF0000 for pure red.
pen_style [Solid, Long-Dashes, Dashes, Dots] The pen style of this line or shape border.
pen_thickness int The thickness of the line or shape border in pixels.
points list This is the list of points that define this line, pen, or polygon object. The other shape types do not provide access to this list.

Methods

Method Arguments Return Description
animate_corner_radius(duration, end_corner_radius, easing, on_finished) duration:float - time in seconds for the animation to run
end_corner_radius:int - the final corner_radius at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this round rectangle's corner_radius to end_corner_radius, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_fill_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final fill_color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's fill_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_pen_color(duration, end_color, easing, on_finished) duration:float - time in seconds for the animation to run
end_color:string - the final pen color at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates fading this object's pen_color to end_color, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.
animate_pen_thickness(duration, end_thickness, easing, on_finished) duration:float - time in seconds for the animation to run
end_thickness:int - the final pen_thickness at the end of the animation
easing:string - an optional argument to allow controlling the animation's start and end accelerations. Using "In" or "InOut" will ramp up the animation speed smoothly at the start, instead of starting the animation at full speed. Using "Out" or "InOut" will ramp down the animation speed smoothly at the end. Setting easing to None or skipping this argument will use simple, linear animation, which can look abrupt, but is sometimes what you want.
on_finished:function - an optional function to run when the animation finishes.
Visually animates changing this object's pen_thickness to end_thickness, over duration seconds. When the animation completes, runs the on_finished function, if one was passed in.

Events

No additional events for this object type.


Group

A group object is created when you group other objects together. It can then be moved, resized, and rotated like other objects, and can contain code to handle the all-objects events, but beware that ungrouping a group destroys any code in the group object itself. (But all code in the objects inside the group remains intact.) Group objects don't have their own specific properties or events, but respond to the following methods, along with everything in the All Objects section. Access an object's properties or methods as, for example, object_name.size or object_name.show(). You can also access a child object of this group as groupName.object_name

Properties

No additional properties for this object type.

Methods

Method Arguments Return Description
stop_all_animating(property_name) property_name:string - optional name of the property to stop animating, for example: "size" or "position". If left blank, stops all animations of properties of this group and its children.
Stops the animation specified by property_name from running on this group and on all objects in this group, or if no property_name is specified, stops all running animations on this group and on all objects in this group. Any animated properties are left at their current, mid-animation values.
ungroup() Ungroups this group. Removes the group object from the card, and adds all of its children back onto the card as individual objects.

Events

No additional events for this object type.