The keyword item specifies that a variable is a pointer (a reference) to an item, such as a Rupee, on the screen.
- 1 Syntax and Initialization
- 2 Properties and Methods
- 2.1 Properties
- 2.2 Methods
- 3 See Also
Syntax and Initialization
Declare a variable as type item as follows:
Until you initialze the variable, it does not actually "point to" any particular item, and thus any properties or methods you attempt to use will be invalid. You must initialize the variable by using the Screen->CreateItem or Screen->LoadItem methods, as follows:
// You can initialize at declaration... item AnItem = Screen->LoadItem(1); // ...or you can initialize later. AnItem = Screen->LoadItem(1);
Properties and Methods
The speed at which this item animates, in screen frames.
This item's CSet.
Retrieves a pointer to the itemdata associated to this object, which contains more properties of the object.
The amount of time the animation is suspended after the last frame, before the animation restarts, in item frames. That is, the total number of screen frames of extra wait is Delay*ASpeed.
An integer representing how the item is to be drawn. Use one of the DS_ constants in std.zh to set or compare this value.
The item's link tile modifier.
Whether or not the item flashes. A flashing item alternates between its CSet and its FlashCSet.
The CSet used during this item's flash frames, if this item flashes.
Whether and how the weapon's tiles should be flipped.
- 0: No flip
- 1: Vertical flip
- 2: Horizontal flip
- 3: Rotate 180 degrees
- 4: Rotate clockwise 90 degrees
- 7: Rotate counter-clockwise 90 degrees
The tile that is this item's current animation frame.
The number of frames in this item's animation.
The starting tile of the item's animation.
The tile associated with this item.
The item's X position on the screen, in pixels.
The item's Y position on the screen, in pixels.
The isValid method indicates whether or not this item pointer is still valid. A return value of true indicates the pointer is still valid.
An item pointer becomes invalid when Link picks up the item, the item fades away, or Link leaves the screen. Accessing any variables using an invalid item pointer prints an error message to allegro.log and does nothing.
- Introduced in Version
- 2.5 (beta)
- Prototype and Arguments