It can access the following attributes:
- version
- width
- height
- dirs
- frames
- loop
- rewind
- movement
- delay
Usage is simple, and a demo is included. If you find any DMI files that don't work, please let me know.
////////////////////////
// //
// DMI Icon Info //
// VERSION 1.1 //
// BY DARKCAMPAINGER //
// //
// REFERENCE //
// //
////////////////////////
//
// > Process a DMI icon
//
new/dmi_info(filename)
//
// > Arguments:
//
// - filename: name of DMI file to process
//
// > Returns:
//
// New /dmi_info object containing the icon's metadata if the
// operation was successful. If the operation fails, the
// 'version' will be equal to -1.
//
//
// > Access icon metadata
//
dmi_info.version // Text string of DMI file format version
dmi_info.width // Number holding width of each icon_state in pixels
dmi_info.height // Number holding height of each icon_state in pixels
dmi_info.states // Indexed list of /dmi_info/dmi_state objects
dmi_info.stateNames // Associative list in form of ("stateName" = /dmi_info/dmi_state object)
//
// > Access icon_state metadata
//
dmi_info.GetStateDirs(stateId)
dmi_info.GetStateFrames(stateId)
dmi_info.GetStateLoop(stateId)
dmi_info.GetStateRewind(stateId)
dmi_info.GetStateMovement(stateId)
//
// > Arguments:
//
// - stateId: text name, numeric index, or reference of state to access
//
// > Returns:
//
// If state exists, returns associated property in numeric form.
// Returns null if the state cannot be found.
//
// > Access icon_state frame metadata
//
dmi_info.GetStateDelay(stateId, [frame])
//
// > Arguments:
//
// - stateId: text name or numeric index of state to access
// - [frame]: frame number to retrieve delay for (optional)
//
// > Returns:
//
// If no frame is specified, returns a list of all of the delays for the state
// If a frame is specified, returns the numeric delay for that frame
// Returns null if the state cannot be found.
// Returns null if the frame was specified and is out of bounds.
//
//
// > Filter/Search icon_states
//
dmi_info.SearchStates(query)
//
// > Arguments:
//
// - query: parameter string of "attribute=value" pairs
//
// > Returns:
//
// List of /dmi_info/dmi_state objects with attributes that match all
// of the given parameters.
//
Update History:
- Version 1.1 (June 3rd, 2012)
- Added SearchStates() process to /dmi_info object to find states matching specific attributes
- The GetState[x]() accessors now accept a reference to the /dmi_info/dmi_state object itself
- Two example DMI files added to the demo
- Version 1.0 (June 3rd, 2012)
- Initial release