BYU Home pageBRIGHAM YOUNG UNIVERSITY
  Office of Digital Humanities
Back     BYU LiveCode Lessons Gateway

Digital Humanities & Technology 210

Properties of Objects in LiveCode

Objectives

By the end of this lesson you should:

  1. Know what is meant by the term property of an object;
  2. Know at least two different ways of showing the property inspector for a LiveCode object;
  3. Know which properties are common to all objects;
  4. Understand that different object types have object-specific properties;
  5. Know what inheritance means and how it effects properties like color and text.
Just like Lego blocks can have different characteristics, so can LiveCode objects

Just as Lego blocks can have different
characteristics, so can LiveCode objects

As mentioned in the previous lecture, objects are the basic building blocks in the LiveCode authoring environment. There are several different types of objects: stacks, cards, buttons, fields, graphics, etc. Apart from being fundamentally dissimilar, they also have characteristic variances within object types. Just like Lego blocks, these objects all come in different shapes, sizes, and colors. In LiveCode, these characteristics are called properties.

All objects in LiveCode have properties or distinct characteristics that determine how they appear and behave. As with Legos the objects can be very generic or very specialized, all depending upon what the specific properties of the object are.

You can access an object’s properties easily by double-clicking on the desired object with the pointer tool while in edit mode, or by selecting the appropriate inspector under the Object menu. This will cause the properties of the particular object to be displayed in the Property Inspector palette.

The Property Inspector

Once the Property Inspector is visible, each time a different object is selected with the pointer tool (or with the selector option in the top right of the inspector palette), the inspector changes to display the properties for that object. Let’s look first at properties common to all objects, and then move into important properties that are unique to various objects.

Property inspector for a button object.
This is the Basic Properties pane.

The Basic Properties Pane

You should be aware that most objects share several common, basic properties. Several of these common properties are found in the Basic Properties pane of the property inspector. Some of the other common properties are found in other sections of the property inspector.


The option menu at the top of the property
inspector lets you switch between the
various sections of property sets.

Property Inspector Sections

The properties for each object have been organized into different sections. At the top of the inspector is a menu through which one can jump between sections. By default the Basic Properties is selected the first time the inspector is opened (as displayed above). The different sections available depend upon the type of object selected.


Virtually all LiveCode objects have these
size and position properties.

Size & Position

In the Size & Position pane of the property inspector we find the following common properties, which pertain to almost all LiveCode objects:


You can set the transparency level of
LiveCode objects in the Blending pane
of the property inspector.

Blending

In LiveCode all objects can have a blend or transparency level.


There are a few other common properties, which will be addressed in Inheritance section below.

Properties for Particular Objects

If you watch the Property Inspector window as you select different objects, you will see that the properties displayed change according to the type of object selected, sometimes quite drastically. For now we will cover only certain commonly used properties. Some properties are more or less self-explanatory and will not be covered in depth here. The best way to learn about properties is by exploring property inspectors for objects on your own in LiveCode. That said, let’s look at a few properties that are unique to the various object types, and which are important to know about.

Stack

A few stack properties you should be aware of:

Card

One unique card property that you should know about:

Group

Groups are a unique object type and will be covered in a later lecture. There is one property that is fundamentally important to how a group behaves. We’ll mention it here but discuss it in detail later.

Button

Since buttons are one of the most commonly-used control objects, there are a few properties with which we need to be familiar:

Field

Fields are another control object we will use quite frequently.

Graphic

The available properties change depending upon the type of graphic object. All of them have to do with physical attributes of the graphic and allow you to change those properties manually here.

Inheritance

There is an object hierarchy in LiveCode through which properties settings are passed or “inherited,” much like physical characteristics and personality traits within a biological family. Properties for a particular object are “inherited” from another object higher in the hierarchy. It may be viewed in terms of ownership: Stacks contain and therefore own cards and groups, which in turn contain and own control objects such as buttons, fields, images, etc. In biological terms, stacks are grandparents, cards and groups are parents, and buttons and fields are the children. Properties are passed or inherited through that hierarchy. Consequently, if a stack has a particular property value, then all objects owned by that stack inherit the same property value. Changing that particular characteristic subsequently changes the property for all objects below that object in the hierarchy (here the biological metaphor breaks down). Property values are passed only down the hierarchy. They never move up, nor do they affect objects that exist together on the same card.

There are a few inherited properties whose effects are obviously noticeable:

The Colors and Patterns pane for a field object.

Color

The Colors & Patterns pane of an object’s property inspector show the the several color properties that can be set for the object. When these properties are not set for an object they are determined by inheritance from parent objects. There are many colors that may be chosen for any given object, and there are several different aspects of the object you can select colors for. The most common properties you might want to change for an object are be the Text (foreground) and the Fill (background). For most objects the text color determines the color of the text being displayed by the object, or the color of the stroke or outline of the object. The fill color, of course, indicates the interior color of the object itself. There are variations between objects and within object types, which you will readily see as you experiment with color settings. Once a color has been set for an object, you can click the Clear button to reset the color value to what the object had inherited through the object hierarchy.

As the name of this pane implies, you can also choose patterns to fill the background or other color areas of the object.


The Text Formatting property pane for a field object.

Text

These properties determine how the text for the object is displayed (e.g., font, size, alignment within the object, etc.) The margins surrounding that text can also be changed. As mentioned before, when these properties are altered for stack, card, and group objects, these settings also are applied to all child objects in their hierarchies, assuming those properties have not been set for the child objects.


As hinted at previously, there are so many other properties that we cannot adequately cover them here without causing you drastic overload. Please take the time to experiment with the various objects and determine how these and other properties alter the appearance and function of the various objects.

Object/Property Exercise, Part 2

Back     BYU LiveCode Lessons Gateway
Maintained by Devin Asay.
Copyright © 2005 Brigham Young University