Name
GetAttribute -- get information about an object
Synopsis
info = GetAttribute(obj, id, attr[, param, param2])
Function
This function can be used to retrieve properties from all different kinds of Hollywood objects. For example, you can query the dimensions of a brush or the length of sound file. Please see below for a complete list of object types and their attributes.

The following attributes can be queried for #ANIM:

#ATTRWIDTH:
Returns width of the animation.

#ATTRHEIGHT:
Returns height of the animation.

#ATTRTRANSPARENTCOLOR:
Returns the transparent color of the animation or #NOTRANSPARENCY.

#ATTRNUMFRAMES:
Returns the number of frames in this animation. (V2.0)

#ATTRHASMASK:
Returns True if animation has a mask. (V2.0)

#ATTRHASALPHA:
Returns True if animation has an alpha channel. (V4.5)

#ATTRFRAMEDELAY:
Returns the time anim players should wait after the specified frame in milliseconds. You also need to specify the frame number you want to query in the param argument. Frames are counted from 1. If you leave out the param argument, the first frame will be used. Please note that not all animation formats support frame delays and that the information might only be available for frames that are already loaded; i.e. if you are querying a random frame of a disk-based anim, it could be that you get a zero return value because the frame has not been loaded yet. (V4.5)

#ATTRCOUNT:
Returns how many animations there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRLOADER:
Returns the name of the loader that was used to load this animation. (V6.0)

#ATTRDEPTH:
Returns the depth of the frame specified in the param argument. Frames are counted from 1. If the param argument is omitted, the first frame will be used. If the depth is less than or equal to 8, the anim is a palette anim. (V9.0)

#ATTRPALETTE:
Returns the palette of the frame specified in the param argument. Frames are counted from 1. If the param argument is omitted, the first frame will be used. The frame's palette will be returned as a table and will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the frame doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the palette of the frame specified by param. Frames are counted from 1. If the param argument is omitted, the first frame will be used. If there is no transparent pen or the frame doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRTYPE:
Returns the type of the anim. This will be set to either #ANIMTYPE_RASTER for a raster anim or #ANIMTYPE_VECTOR for a vector anim. (V9.0)

#ATTRFORMAT:
Returns the anim format name as a string. (V10.0)

The following attributes can be queried for #ANIMSTREAM:

#ATTRCOUNT:
Returns how many anim stream objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

The following attributes can be queried for #ASYNCDRAW:

#ATTRTYPE:
Returns the type of this asynchronous drawing object; will be #ADF_FX, #ADF_MOVEOBJECT or #ADF_ANIM. (V4.5)

#ATTRNUMFRAMES:
Returns the number of frames of this asynchronous drawing object; please note that if you use this value as the base for a loop over AsyncDrawFrame(), you must add one loop because the final call to AsyncDrawFrame() does not count as a frame; See AsyncDrawFrame for details. (V4.5)

#ATTRCURFRAME:
Returns the frame currently on display in this async drawing object. (V4.5)

#ATTRCOUNT:
Returns how many async draw objects there are currently in memory. Useful for tracking memory consumption. (V4.5)

The following attributes can be queried for #ASYNCOBJ:

#ATTRCOUNT:
Returns how many asynchronous operation handles there are currently in memory. Useful for tracking memory consumption. (V9.0)

The following attributes can be queried for #BGPIC:

#ATTRWIDTH:
Returns width of the BGPic.

#ATTRHEIGHT:
Returns height of the BGPic.

#ATTRTRANSPARENTCOLOR:
Returns the transparent color of the BGPic or #NOTRANSPARENCY.

#ATTRLAYERS:
Returns the number of layers attached to this BGPic. (V1.5)

#ATTRHASMASK:
Returns True if BGPic has a mask. (V2.0)

#ATTRHASALPHA:
Returns True if BGPic has an alpha channel. (V4.5)

#ATTRCLIPREGION:
Returns the identifier of the clip region currently active on this BGPic or -1 if there is no active clip region. (V4.5)

#ATTRCOUNT:
Returns how many BGPics there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRTYPE:
Returns the type of the BGPic. This will be set to either #IMAGETYPE_RASTER for a raster BGPic or #IMAGETYPE_VECTOR for a vector BGPic. (V5.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this BGPic. (V6.0)

#ATTRSPRITES:
Returns the number of sprites currently visible on this BGPic. (V7.0)

#ATTRDEPTH:
Returns the depth of the BGPic. If this is less than or equal to 8, the BGPic is a palette BGPic. (V9.0)

#ATTRPALETTE:
Returns the BGPic's palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the BGPic doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the BGPic's palette. If there is no transparent pen or the BGPic doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRCYCLE:
If the BGPic has a palette which has color cycling ranges defined, this attribute will return a table containing all color cycling ranges that are defined. In that case, the table returned by #ATTRCYCLE will contain a number of subtables which will have the following fields initialized:

Low:
The pen index that marks that start of the color range.

High:
The pen index that marks the end of the color range.

Rate:
The desired speed of the color cycling effect. A value of 16384 indicates 60 frames per second. All other speeds scale linearly from this base, e.g. a value of 8192 indicates 30 frames per second, and so on.

Reverse:
If this tag is set to True, the colors should be cycled in reverse.

Active:
If this tag is set to True, this color cycling range is marked as active.

(V9.0)

#ATTRFORMAT:
Returns the image format name as a string. (V10.0)

The following attributes can be queried for #BRUSH:

#ATTRWIDTH:
Returns width of the brush.

#ATTRHEIGHT:
Returns height of the brush.

#ATTRTRANSPARENTCOLOR:
Returns the transparent color of the brush or #NOTRANSPARENCY.

#ATTRHASMASK:
Returns True if brush has a mask. (V2.0)

#ATTRHASALPHA:
Returns True if brush has an alpha channel. (V2.0)

#ATTRCOUNT:
Returns how many brushes there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRTYPE:
Returns the type of the brush. This will be set to either #IMAGETYPE_RASTER for a raster brush or #IMAGETYPE_VECTOR for a vector brush. (V5.0)

#ATTRHARDWARE:
Returns True if the specified brush is a hardware brush. See hardware brushes for details. (V5.0)

#ATTRDISPLAY:
Returns the identifier of the display that this brush belongs to if the brush is a display-dependent hardware brush. Otherwise -1 is returned. See hardware brushes for details. (V6.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this brush. (V6.0)

#ATTRDEPTH:
Returns the depth of the brush. If this is less than or equal to 8, the brush is a palette brush. (V9.0)

#ATTRPALETTE:
Returns the brush's palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the brush doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the brush's palette. If there is no transparent pen or the brush doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRCYCLE:
If the brush has a palette which has color cycling ranges defined, this attribute will return a table containing all color cycling ranges that are defined. In that case, the table returned by #ATTRCYCLE will contain a number of subtables which will have the following fields initialized:

Low:
The pen index that marks that start of the color range.

High:
The pen index that marks the end of the color range.

Rate:
The desired speed of the color cycling effect. A value of 16384 indicates 60 frames per second. All other speeds scale linearly from this base, e.g. a value of 8192 indicates 30 frames per second, and so on.

Reverse:
If this tag is set to True, the colors should be cycled in reverse.

Active:
If this tag is set to True, this color cycling range is marked as active.

(V9.0)

#ATTRFORMAT:
Returns the image format name as a string. (V10.0)

The following attributes can be queried for #CLIENT:

#ATTRCOUNT:
Returns how many network client objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

#ATTRADAPTER:
Returns the name of the adapter that has been used to open this connection or inbuilt if the connection has been opened using Hollywood's inbuilt connection handler. (V8.0)

The following attributes can be queried for #CLIPREGION:

#ATTRXPOS:
Returns the x-position of the clip region. (V3.0)

#ATTRYPOS:
Returns the y-position of the clip region. (V3.0)

#ATTRWIDTH:
Returns the width of the clip region. (V3.0)

#ATTRHEIGHT:
Returns the height of the clip region. (V3.0)

#ATTRCOUNT:
Returns how many clip regions there are currently in memory. Useful for tracking memory consumption. (V4.5)

The following attributes can be queried for #CONSOLEWINDOW:

#ATTRCOUNT:
Returns how many console windows are currently in memory. Useful for tracking memory consumption. (V10.0)

The following attributes can be queried for #DIRECTORY:

#ATTRCOUNT:
Returns how many directory handles there are currently open. Useful for tracking resources. (V4.5)

#ATTRADAPTER:
Returns the name of the adapter that has been used to open this directory or inbuilt if this directory has been opened using Hollywood's inbuilt directory handler. (V6.0)

#ATTRFORMAT:
Returns the directory format name as a string. This is typically only set if the directory is handled by a plugin because by default, directories don't have a "format" but plugins might implement adapters that map zip files et al. to directories. In that case, #ATTRFORMAT allows you to find out the format of the directory source, e.g. "zip archive". (V10.0)

The following attributes can be queried for #DISPLAY:

#ATTRWIDTH:
Returns the width of the display; this value does not include the width of the window border.

#ATTRHEIGHT:
Returns the height of the display; this value does not include the height of the window border.

#ATTRMAXWIDTH:
Returns the maximum possible width for this display (i.e. current desktop resolution minus border width).

#ATTRMAXHEIGHT:
Returns the maximum possible height for this display (i.e. current desktop resolution minus border height).

#ATTRBGPIC:
Returns the BGPic associated with this display. (V1.5)

#ATTRLAYERS:
Returns the number of layers in the associated BGPic. (V1.5)

#ATTRCURSORX:
Returns current x-position of the cursor. (V2.5)

#ATTRCURSORY:
Returns current y-position of the cursor. (V2.5)

#ATTRXPOS:
Returns the x-position of the display on the screen. (V3.0)

#ATTRYPOS:
Returns the y-position of the display on the screen. (V3.0)

#ATTRBORDERLEFT:
Returns the width of the left display border or 0 if the display is borderless. (V3.0)

#ATTRBORDERRIGHT:
Returns the width of the right display border or 0 if the display is borderless. (V3.0)

#ATTRBORDERTOP:
Returns the height of the top display border or 0 if the display is borderless. (V3.0)

#ATTRBORDERBOTTOM:
Returns the height of the bottom display border or 0 if the display is borderless. (V3.0)

#ATTRHOSTWIDTH:
Returns the width of the screen on which the display is open (usually the desktop screen). (V3.0)

#ATTRHOSTHEIGHT:
Returns the height of the screen on which the display is open (usually the desktop screen). (V3.0)

#ATTRFONTASCENDER, #ATTRFONTDESCENDER, #ATTRFONTNAME, #ATTRFONTSIZE, #ATTRFONTSCALABLE, #ATTRFONTAA, #ATTRFONTDEPTH, #ATTRFONTPALETTE, #ATTRFONTTRANSPARENTPEN, #ATTRFONTENGINE, #ATTRFONTTYPE, #ATTRFONTCHARMAP, #ATTRFONTLOADER, #ATTRFONTHEIGHT, #ATTRFONTFORMAT:
Information about the font currently selected into this display; please read below in #TEXTOBJECT for the info on these attributes. (V3.1)

#ATTRPOINTER:
Returns the identifier of the mouse pointer currently associated with this display. (V4.5)

#ATTRSTATE:
Returns the current state of this display; can be either #DISPSTATE_OPEN (if display is open), or #DISPSTATE_CLOSED (display is currently closed), or #DISPSTATE_MINIMIZED (display is currently minimized). (V4.5)

#ATTRACTIVE:
Returns whether or not this display is currently active; only one display can be active at a time. (V4.5)

#ATTRMODE:
Returns the current display mode; this can be either #DISPMODE_WINDOWED for windowed mode or it can be #DISPMODE_FULLSCREEN for full screen mode. Note that this is a global setting. You can safely pass 0 for display when querying #ATTRMODE. (V4.5)

#ATTRSCALEMODE:
Returns the scale mode currently active in this display. Can be either #SCALEMODE_NONE, #SCALEMODE_AUTO, or #SCALEMODE_LAYER. (V4.5)

#ATTRSCALEWIDTH:
Returns the currently set scaling width for this display. If no scaling is active, this attribute will return the same width as #ATTRWIDTH. (V4.5)

#ATTRSCALEHEIGHT:
Returns the currently set scaling height for this display. If no scaling is active, this attribute will return the same height as #ATTRHEIGHT. (V4.5)

#ATTRBORDERLESS:
Returns whether or not the display is borderless. (V4.5)

#ATTRSIZEABLE:
Returns whether or not the display is resizeable. (V4.5)

#ATTRFIXED:
Returns whether or not the display is fixed. (V4.5)

#ATTRNOHIDE:
Returns whether or not the display can be iconified by the user. (V4.5)

#ATTRNOMODESWITCH:
Returns True if display mode switching via CMD+RETURN (LALT+RETURN on Windows) hotkey is disabled for this display. (V4.5)

#ATTRTITLE:
Returns the display's title string. (V4.5)

#ATTRMARGINLEFT, #ATTRMARGINRIGHT:
Returns the current margin settings for this display as set using SetMargins(). (V4.5)

#ATTRDOUBLEBUFFER:
Returns True if the specified display is a double- buffered one, False if it is not double-buffered. (V4.5)

#ATTROUTPUTDEVICE:
This attribute returns three values containing information about the current output device. The first return value can be either #DISPLAY, #BGPIC, #BRUSH, #ANIM, or #DOUBLEBUFFER. The second return value specifies the corresponding identifier to the type indicated by the first return value. The third return value, finally, is only used by types #BRUSH, #ANIM and #BGPIC (NB: For #BGPIC it is only used when SelectBGPic() was called with mode set to either #SELMODE_NORMAL or #SELMODE_COMBO). In that case, it specifies the graphics of the brush/animation/BGPic that are currently selected: This can be either #MASK, #ALPHACHANNEL or #BRUSH. Note that the third return value will be set to #BRUSH also in case #ANIM/#BGPIC is returned by the first return value. If #BRUSH is returned as the third return value, it means that the color channel of the brush/animation is currently selected. If SelectBGPic() is in #SELMODE_LAYERS, the first and third return value will both be #BGPIC. If SelectBGPic() is in a different mode, the first return value will be #BGPIC, but the third return value will be either #BRUSH, #MASK, or #ALPHACHANNEL. (V4.5)

#ATTRCOUNT:
Returns how many display handles there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRMASKMODE:
Returns the current mask mode. This is a global setting not tied to a specific display. See SetMaskMode for details. (V4.5)

#ATTRALPHAINTENSITY:
Returns the current alpha intensity. This is a global setting not tied to a specific display. See SetAlphaIntensity for details. (V4.5)

#ATTRLAYERSON:
Returns True if the specified display has layers enabled, False if that is not the case. (V5.0)

#ATTRORIENTATION:
Returns the current orientation of the mobile device that Hollywood is running on. The return value will be one of the following orientation modes:

 
#ORIENTATION_PORTRAIT
#ORIENTATION_LANDSCAPE
#ORIENTATION_PORTRAITREV
#ORIENTATION_LANDSCAPEREV

Please note that this tag is only supported in the mobile version of Hollywood. In the desktop version it will always return #ORIENTATION_NONE. (V5.0)

#ATTRPUBSCREEN:
Returns the public screen that this display is currently opened on. This is only supported on AmigaOS compatible operating systems. (V5.2)

#ATTRDENSITY:
Returns the logical density of the display. The return value will be one of the following predefined density values:

 
#DENSITY_LOW
#DENSITY_MEDIUM
#DENSITY_HIGH

Please note that this tag is only supported in the mobile version of Hollywood. In the desktop version it will always return #DENSITY_NONE. (V5.3)

#ATTRXDPI:
Returns the exact physical pixels per inch of the screen on the X axis. Please note that this tag may return a spurious value on older Android devices. (V5.3)

#ATTRYDPI:
Returns the exact physical pixels per inch of the screen on the Y axis. Please note that this tag may return a spurious value on older Android devices. (V5.3)

#ATTRMENU:
Returns the identifier of the menu strip attached to this display or -1 if this display doesn't have a menu strip attached. (V6.0)

#ATTRMONITOR:
Returns the monitor number that this display has been opened on. Monitors are counted from 1 which is the primary monitor. (V6.0)

#ATTRHOSTMONITORS:
Returns the total number of monitors currently available to the system. You can query their dimensions and extended desktop positions using GetMonitors(). (V6.0)

#ATTRXSERVER:
Returns the name of the X Server that this display is connected to. This is only supported on Linux. (V6.0)

#ATTRADAPTER:
Returns the name of the display adapter currently in use. If Hollywood's inbuilt display adapter is used, inbuilt is returned. (V6.0)

#ATTRMAXIMIZED:
Returns True if the display is currently maximized, False otherwise. (V7.0)

#ATTRRAWWIDTH:
Returns the raw physical width of the display, regardless of any scaling engine currently active. Use this attribute with care because it can conflict with scaling engines because they always pretend that Hollywood is in running in a different resolution. (V7.0)

#ATTRRAWHEIGHT:
Returns the raw physical height of the display, regardless of any scaling engine currently active. Use this attribute with care because it can conflict with scaling engines because they always pretend that Hollywood is in running in a different resolution. (V7.0)

#ATTRHOSTTITLEBARHEIGHT:
Returns the height of the host screen's title bar. Note that not all systems have a title bar, most notably Windows doesn't have any. In that case, 0 is returned. (V7.0)

#ATTRHOSTTASKBAR:
Returns information about the taskbar on Windows. This tag will return 5 values: The first two values describe the x- and y-position of the taskbar on the host screen, return values three and four contain the dimensions of the taskbar and the fifth and last return value is a boolean which indicates whether or not the taskbar is currently visible. This tag is currently only supported on Windows. (V7.0)

#ATTRSPRITES:
Returns the number of sprites currently active on this display. (V7.0)

#ATTRHOSTSCALEX:
Returns the scaling coefficient on the x-axis of the display's monitor. Normally, this is 1 but for high resolution displays (e.g. Retina Macs or 4K monitors on Windows) this can be greater than 1. Note that on Windows this will always be 1 unless you explicitly enable DPI-awareness by setting the DPIAware tag in the @OPTIONS preprocessor command to True. (V7.0)

#ATTRHOSTSCALEY:
Returns the scaling coefficient on the y-axis of the display's monitor. Normally, this is 1 but for high resolution displays (e.g. Retina Macs or 4K monitors on Windows) this can be greater than 1. Note that on Windows this will always be 1 unless you explicitly enable DPI-awareness by setting the DPIAware tag in the @OPTIONS preprocessor command to True. (V7.0)

#ATTRHOSTSCALE:
Returns the global scaling coefficient of the display's monitor. Normally, this is 1 but for high resolution displays (e.g. Retina Macs or 4K monitors on Windows) this can be greater than 1. Note that on Windows this will always be 1 unless you explicitly enable DPI-awareness by setting the DPIAware tag in the @OPTIONS preprocessor command to True. (V8.0)

#ATTRIMMERSIVEMODE:
Returns the immersive mode used by the display. The return value will be one of the following special constants:

 
#IMMERSIVE_NONE
#IMMERSIVE_NORMAL
#IMMERSIVE_LEANBACK
#IMMERSIVE_STICKY

See DISPLAY for details. (V9.0)

#ATTRSYSTEMBARS:
Returns True if the system bars are currently visible, False otherwise. This is currently only supported on Android. Note that the system bars can only ever be invisible when a display is in immersive mode. See DISPLAY for details. (V9.0)

#ATTRDEPTH:
Returns the depth of the display. If this is less than or equal to 8, the display is a palette mode display. See Palette mode displays for details. (V9.0)

#ATTRPALETTE:
Returns the display's palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the display doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the display's palette. If there is no transparent pen or the display doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRPALETTEMODE:
Returns the current palette mode set using SetPaletteMode(). See SetPaletteMode for details. (V9.0)

#ATTRDITHERMODE:
Returns the current dither mode set using SetDitherMode(). See SetDitherMode for details. (V9.0)

#ATTRPEN:
Returns the current draw pen set using SetDrawPen(). See SetDrawPen for details. (V9.0)

#ATTRSHADOWPEN:
Returns the current shadow pen set using SetShadowPen(). See SetShadowPen for details. (V9.0)

#ATTRBORDERPEN:
Returns the current border pen set using SetBorderPen(). See SetBorderPen for details. (V9.0)

#ATTRBULLETPEN:
Returns the current bullet pen set using SetBulletPen(). See SetBulletPen for details. (V9.0)

#ATTRSCALESWITCH:
Returns if this display will just scale itself to the monitor's current resolution when pressing the CMD+RETURN (LALT+RETURN on Windows) hotkey or using #DISPMODE_MODESWITCH with ChangeDisplayMode(). (V9.0)

#ATTRINTERPOLATE:
When a scaling engine is active, this will return whether or not interpolated scaling will be used. (V9.0)

The following attributes can be queried for #EVENTHANDLER:

#ATTRFUNCTION:
Returns the callback function associated with the specified event handler. Note that you need to pass the name of the event handler as a string in id. Just as you would do in InstallEventHandler(). (V4.5)

#ATTRUSERDATA:
Returns the user data that is associated with the specified event handler. Note that you need to pass the name of the event handler as a string in id. Just as you would do in InstallEventHandler(). (V4.5)

The following attributes can be queried for #FILE:

#ATTRMODE:
Returns the mode this file was opened in. Can be either #MODE_READ, #MODE_WRITE, or #MODE_READWRITE. (V4.5)

#ATTRCOUNT:
Returns how many file handles there are currently open. Useful for tracking resources. (V4.5)

#ATTRADAPTER:
Returns the name of the adapter that has been used to open this file or inbuilt if this file has been opened using Hollywood's inbuilt file handler. (V6.0)

#ATTRENCODING:
Returns the encoding set for the file using OpenFile() or SetFileEncoding(). See SetDefaultEncoding for a list of encodings. (V9.0)

#ATTRFORMAT:
Returns the file format as a string. This is typically only set if the file is handled by a plugin because Hollywood's default file handler doesn't provide any format recognition. Plugins, however, might implement adapters that allow you to open files from zip archives etc. In that case, #ATTRFORMAT allows you to find out the format of the file source, e.g. "zip archive".(V10.0)

The following attributes can be queried for #FONT:

#ATTRFONTASCENDER, #ATTRFONTDESCENDER, #ATTRFONTNAME, #ATTRFONTSIZE, #ATTRFONTSCALABLE, #ATTRFONTAA, #ATTRFONTDEPTH, #ATTRFONTPALETTE, #ATTRFONTTRANSPARENTPEN, #ATTRFONTENGINE, #ATTRFONTTYPE, #ATTRFONTCHARMAP, #ATTRFONTLOADER, #ATTRFONTHEIGHT, #ATTRFONTFORMAT:
Please see below in #TEXTOBJECT for information about the meaning of these attributes. (V4.5)

#ATTRCOUNT:
Returns how many fonts there are currently in memory. Useful for tracking memory consumption. (V4.5)

The following attributes can be queried for #ICON:

#ATTRNUMENTRIES:
Returns the number of images in the icon. (V8.0)

#ATTRSTANDARD:
Returns the index of the standard image in the icon or 0 in case there is no standard image in the icon. (V8.0)

#ATTRWIDTH:
Returns the width of the image at the index specified in the optional param argument. Indices start at 1. (V8.0)

#ATTRHEIGHT:
Returns the height of the image at the index specified in the optional param argument. Indices start at 1. (V8.0)

#ATTRNUMFRAMES:
Returns the number of frames of the image at the index specified in the optional param argument. This can be either 1 or 2, depending on whether the image has only a normal state, or a normal and a selected state. Indices start at 1. (V8.0)

#ATTRCOUNT:
Returns how many icons are currently in memory. Useful for tracking memory consumption. (V8.0)

#ATTRDEPTH:
Returns the depth of the image at the index specified in the param argument. Indices start at 1. If param2 is set to True the selected image is queried, if it is False (also the default) the normal image is queried. If the depth is less than or equal to 8, the image is a palette image. (V9.0)

#ATTRPALETTE:
Returns the palette of the image at the index specified in the param argument. Indices start at 1. If param2 is set to True the selected image is queried, if it is False (also the default) the normal image is queried. The image's palette will be returned as a table and will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the image doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the palette of the image at the index specified in the param argument. Indices start at 1. If param2 is set to True the selected image is queried, if it is False (also the default) the normal image is queried. If there is no transparent pen or the image doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRFORMAT:
Returns the icon format name as a string. (V10.0)

The following attributes can be queried for #INTERVAL:

#ATTRDURATION:
Returns the frequency of this interval object in milliseconds. (V4.5)

#ATTRFUNCTION:
Returns the callback function associated with the specified interval object. (V4.5)

#ATTRUSERDATA:
Returns the user data associated with this interval object. (V4.5)

The following attributes can be queried for #LAYER:

#ATTRTYPE:
Returns the type of the layer (e.g. #PRINT). (V1.5)

#ATTRXPOS:
Returns the x-position of the layer on the display. (V1.5)

#ATTRYPOS:
Returns the y-position of the layer on the display. (V1.5)

#ATTRWIDTH:
Returns width of the layer. (V1.5)

#ATTRHEIGHT:
Returns height of the layer. (V1.5)

#ATTRVISIBLE:
Returns True if the layer is currently visible, False if it is hidden. (V1.5)

#ATTRLAYERID:
Returns the identifier of the specified layer; obviously, this makes only sense if you specify a layer name instead of an id as the source. (V2.0)

#ATTRNUMFRAMES:
Returns the number of frames of this layer; only works when used with layers of type #ANIM (V2.0) or #VIDEO (V6.0).

#ATTRCURFRAME:
Returns the frame which is currently displayed; works only with layers of type #ANIM. Note in contrast to most other commands, frames are counted from 0 here so you'll get 0 for the first frame, not 1. (V2.0)

#ATTRTEXT, #ATTRFONTASCENDER, #ATTRFONTDESCENDER, #ATTRFONTNAME, #ATTRFONTSIZE, #ATTRFONTSCALABLE, #ATTRFONTAA, #ATTRFONTDEPTH, #ATTRFONTPALETTE, #ATTRFONTTRANSPARENTPEN, #ATTRFONTENGINE, #ATTRFONTTYPE, #ATTRFONTCHARMAP, #ATTRFONTLOADER, #ATTRFONTHEIGHT, #ATTRFONTFORMAT:
These attributes can be used with layers of type #PRINT and #TEXTOUT only; to learn more about them read below in the #TEXTOBJECT section. (V4.0)

#ATTRFRAMEDELAY:
Returns the time anim players should wait after displaying the current frame in milliseconds; this works only with layers of type #ANIM. (V4.5)

#ATTRCOUNT:
Returns how many layers there are currently in memory. Useful for tracking memory consumption. Note that this will return the sum of all layers from all BGPics. If you want to query the number of layers in the current BGPic, use #ATTRLAYERS with type #BGPIC. (V4.5)

#ATTRRAWXPOS, #ATTRRAWYPOS, #ATTRRAWWIDTH, #ATTRRAWHEIGHT:
These four attributes can be used to find out the real position and size of a layer. The difference between these attributes and the standard #ATTRXPOS, #ATTRWIDTH etc. attributes is that the standard attributes will always return the position and size of the basic, untransformed layer. The standard attributes will also not take any under/overhangs into account. Still, you should work with the standard attributes whenever possible because the #ATTRRAWxxx attributes operate on a low level in the layers system and could be affected by future changes in the layers system. (V4.7)

#ATTRZPOS:
Returns the z-position of the layer. See SetLayerZPos for details. (V5.1)

#ATTRDURATION:
Returns the video layer's source duration in milliseconds. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRPOSITION:
Returns the current position of a playing or paused video layer in milliseconds. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRFORMAT:
Returns the video layer's source format name as a string. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRCANSEEK:
Returns whether or not SeekLayer() can be used on this video layer. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRPLAYING:
Returns True if this video layer is currently playing. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRPAUSED:
Return True if this video is layer currently paused. This is only supported for layers of type #VIDEO. (V6.0)

#ATTRID:
Returns the identifier of this layer's source object. This is only applicable for layers of type #ANIM, #BRUSH, #BRUSHPART, #BGPICPART, #TEXTOBJECT, #VECTORPATH and #VIDEO. (V6.0)

#ATTRDEPTH:
Returns the depth of the layer. If this is less than or equal to 8, the layer is a palette layer. (V9.0)

#ATTRPALETTE:
Returns the layer's palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the layer doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the layer's palette. If there is no transparent pen or the layer doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRBUTTON:
If the layer is attached to a button, this will return the id of that button. Otherwise Nil will be returned. (V9.1)

#ATTRGROUP:
Returns the name of the group that this layer is attached to or an empty string if the layer isn't attached to a group. See GroupLayer for details. (V10.0)

Please note that the position and size values will always refer to the layer in its original, untransformed state. If you rotate or scale a layer, you will still get its original dimensions through #ATTRWIDTH and #ATTRHEIGHT.

The following attributes can be queried for #MEMORY:

#ATTRSIZE:
Returns the size of specified memory block. (V4.5)

#ATTRCOUNT:
Returns how many memory blocks there are currently in memory. Useful for tracking memory consumption. (V4.5)

The following attributes can be queried for #MENU:

#ATTRCOUNT:
Returns how many menu strips are currently available. Useful for keeping track of the resources used by your script. (V6.0)

The following attributes can be queried for #MOVELIST:

#ATTRCOUNT:
Returns how many move list objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

The following attributes can be queried for #MUSIC:

#ATTRTYPE:
Returns the format of the music raw data; this attribute will return one of #MONO8, #MONO16, #STEREO8 and #STEREO16; not possible with Protracker modules. (V2.0)

#ATTRDURATION:
Returns the music duration in milliseconds. This is unsupported for Protracker modules. If you query #ATTRDURATION for Protracker modules, -1 will be returned. (V2.0)

#ATTRPITCH:
Returns the playback pitch (frequency) of the music in Hertz; not possible with Protracker modules. (V2.0)

#ATTRPOSITION:
Returns the position of the music object in milliseconds. (V2.0)

#ATTRFORMAT:
Returns the music format as a string. (V2.0)

#ATTRBITRATE:
Returns the bitrate of the music object; if the music object is currently playing and uses a variable bitrate, you will receive the bitrate of the current frame; not possible with Protracker modules. (V2.0)

#ATTRCOUNT:
Returns how many music objects there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRCANSEEK:
Returns whether or not SeekMusic() can be used on this music object. (V5.0)

#ATTRNUMSUBSONGS:
Returns the number of subsongs which you can play using PlaySubsong(). If this 1, then there is only one song in the music object. (V5.3)

#ATTRCURSUBSONG:
Returns the number of the currently playing subsong. (V5.3)

#ATTRPLAYING:
Returns True if this music object is currently playing. (V6.0)

#ATTRPAUSED:
Return True if this music object is currently paused. (V6.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this music object. (V6.0)

The following attributes can be queried for #PALETTE:

#ATTRPALETTE:
Returns the palette's pens as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the palette. If there is no transparent pen, #NOPEN will be returned. (V9.0)

#ATTRDEPTH:
Returns the depth of the palette. This will always be a value between 1 (= 2 colors) and 8 (= 256 colors). (V9.0)

#ATTRCYCLE:
If the palette is a one which has color cycling ranges defined, this attribute will return a table containing all color cycling ranges that are defined. In that case, the table returned by #ATTRCYCLE will contain a number of subtables which will have the following fields initialized:

Low:
The pen index that marks that start of the color range.

High:
The pen index that marks the end of the color range.

Rate:
The desired speed of the color cycling effect. A value of 16384 indicates 60 frames per second. All other speeds scale linearly from this base, e.g. a value of 8192 indicates 30 frames per second, and so on.

Reverse:
If this tag is set to True, the colors should be cycled in reverse.

Active:
If this tag is set to True, this color cycling range is marked as active.

(V9.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this palette. (V9.0)

#ATTRCOUNT:
Returns how many palette objects there are currently in memory. Useful for tracking memory consumption. (V9.0)

The following attributes can be queried for #POINTER:

#ATTRWIDTH:
Returns the width of the pointer image. (V4.5)

#ATTRHEIGHT:
Returns the height of the pointer image. (V4.5)

#ATTRTYPE:
Returns type of this pointer image; can be #STDPTR_CUSTOM, #STDPTR_SYSTEM or #STDPTR_BUSY; See CreatePointer for details. (V4.5)

#ATTRCOUNT:
Returns how many pointer images there are currently in memory. Useful for tracking memory consumption. (V4.5)

The following attributes can be queried for #SAMPLE:

#ATTRTYPE:
Returns the format of the samples raw data; this attribute will return one of #MONO8, #MONO16, #STEREO8 and #STEREO16. (V2.0)

#ATTRDURATION:
Returns the sample duration in milliseconds. (V2.0)

#ATTRPITCH:
Returns the playback pitch (frequency) of the sample in hertz. (V2.0)

#ATTRPOSITION:
Returns how long the sample has been playing and how many times it has looped. The position returned will be a value in milliseconds (1000 milliseconds = 1 second). This value will be reset everytime the sample loops so that the returned position value will never exceed the sample length. The second return value specifies how many times the sample was played. It will be increased by one every time the sample loops. If you need to find out the total playing time in milliseconds, just multiply the second return value minus 1 by the sample duration (use #ATTRDURATION) and add the first return value to it. (V2.0)

#ATTRCOUNT:
Returns how many samples there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRNUMFRAMES:
Returns the number of PCM frames in the sample. (V5.0)

#ATTRPLAYING:
Returns True if this sample is currently playing. (V6.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this sample. (V6.0)

#ATTRFORMAT:
Returns the sound format name as a string. (V10.0)

The following attributes can be queried for #SERIAL:

#ATTRCOUNT:
Returns how many serial connection objects are currently in memory. Useful for keeping track of the resources used by your script. (V8.0)

The following attributes can be queried for #SERVER:

#ATTRCOUNT:
Returns how many network server objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

The following attributes can be queried for #SPRITE:

#ATTRWIDTH:
Returns width of the sprite. (V2.0)

#ATTRHEIGHT:
Returns height of the sprite. (V2.0)

#ATTRTRANSPARENTCOLOR:
Returns the transparent color of the sprite or #NOTRANSPARENCY. (V2.0)

#ATTRHASMASK:
Returns True if sprite has a mask. (V2.0)

#ATTRHASALPHA:
Returns True if sprite has an alpha channel. (V2.0)

#ATTRNUMFRAMES:
Returns the number of frames in this sprite. (V2.0)

#ATTRCURFRAME:
Returns the frame which is currently displayed. (V2.0)

#ATTRONSCREEN:
Returns True if the specified sprite is currently on screen. (V2.5)

#ATTRXPOS:
Returns the x-position of the sprite on the screen. (V2.5)

#ATTRYPOS:
Returns the y-position of the sprite on the screen. (V2.5)

#ATTRCOUNT:
Returns how many sprites there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRZPOS:
Returns the z-position of the sprite. See SetSpriteZPos for details. (V7.0)

#ATTRDEPTH:
Returns the depth of the frame specified in the param argument. Frames are counted from 1. If the param argument is omitted, the first frame will be used. If the depth is less than or equal to 8, the sprite is a palette sprite. (V9.0)

#ATTRPALETTE:
Returns the palette of the frame specified in the param argument. Frames are counted from 1. If the param argument is omitted, the first frame will be used. The frame's palette will be returned as a table and will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the frame doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the palette of the frame specified by param. Frames are counted from 1. If the param argument is omitted, the first frame will be used. If there is no transparent pen or the frame doesn't have a palette, #NOPEN will be returned. (V9.0)

The following attributes can be queried for #TEXTOBJECT:

#ATTRWIDTH:
Returns width of the text object.

#ATTRHEIGHT:
Returns height of the text object.

#ATTRFONTASCENDER:
Returns the ascender of the current font in pixels; the ascender of a font is the maximum character extent from the baseline to the top of the line; ascender + descender is always equal to the font's pixel height. (V3.1)

#ATTRFONTDESCENDER:
Returns the descender of the current font in pixels; the descender of a font is the maximum character extent from the baseline to the bottom of the line; ascender + descender is always equal to the font's pixel height. (V3.1)

#ATTRFONTNAME:
Returns the name of the currently selected font. (V3.1)

#ATTRFONTSIZE:
Returns the size of the currently selected font. (V3.1)

#ATTRFONTSCALABLE:
Returns True if the font is a scalable vector font. (V3.1)

#ATTRFONTAA:
Returns True if the font can be anti-aliased. (V3.1)

#ATTRTEXT:
Returns the text string of this text object. (V4.0)

#ATTRCOUNT:
Returns how many text objects there are currently in memory. Useful for tracking memory consumption. (V4.5)

#ATTRDEPTH:
Returns the depth of the text object. If this is less than or equal to 8, the brush is a palette text object. (V9.0)

#ATTRPALETTE:
Returns the text object's palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. If the text object doesn't have a palette, an empty table will be returned. (V9.0)

#ATTRTRANSPARENTPEN:
Returns the pen that is transparent in the text object's palette. If there is no transparent pen or the text object doesn't have a palette, #NOPEN will be returned. (V9.0)

#ATTRTYPE:
Returns the type of the text object. This will be set to either #IMAGETYPE_RASTER for a raster text object or #IMAGETYPE_VECTOR for a vector text object. (V10.0)

#ATTRFONTDEPTH:
If the font is an Amiga color font, this attribute will return its depth. (V9.0)

#ATTRFONTPALETTE:
If the font is an Amiga color font, this attribute will return its palette as a table. The table will contain as many items as there are pens in the palette. The individual pens will be returned as RGB colors. (V9.0)

#ATTRFONTTRANSPARENTPEN:
If the font is an Amiga color font, this attribute will return the pen that is transparent in the font's palette. (V9.0)

#ATTRFONTENGINE:
Returns the engine that was used to open this font. This will be either #FONTENGINE_INBUILT, #FONTENGINE_NATIVE or #FONTENGINE_PLUGIN. See SetFont for details. (V9.0)

#ATTRFONTTYPE:
Returns the font type. This can be one of the following types:

#FONTTYPE_BITMAP:
An Amiga bitmap font.

#FONTTYPE_COLOR:
An Amiga color font.

#FONTTYPE_VECTOR:
A vector font, e.g. in TrueType or OpenType format.

#FONTTYPE_BRUSH:
A custom font created from a brush source using the CreateFont() command. See CreateFont for details. (V10.0)

(V9.0)

#ATTRFONTCHARMAP:
Returns the character map used by the font. This is only supported by fonts managed by the inbuilt font engine, i.e. the font must have been opened using #FONTENGINE_INBUILT. See GetCharMaps for details. (V9.0)

#ATTRFONTLOADER:
Returns the name of the loader that was used to load this font. (V10.0)

#ATTRFONTHEIGHT:
Returns the pixel height of the font. This is often the same as #ATTRFONTSIZE but not if the font has been opened in points mode or if the underlying text engine interprets the font size as something different from the font height. In any case, #ATTRFONTHEIGHT will always be the same as #ATTRFONTASCENDER + #ATTRFONTDESCENDER. (V10.0)

#ATTRFONTFORMAT:
Returns the font format name as a string. (V10.0)

#ATTRADJUSTX:
When drawing text objects using DisplayTextObject() Hollywood will position them in a way that they appear as if they had been drawn using TextOut() which means that they could be offset to the left and top in case parts of some characters are designed to appear in the area of previous characters. This is often the case with characters like "j". You can query the number of horizontal pixels Hollywood will offset the text object by querying this tag. Adjustment of text objects can be disabled by setting NoAdjust to True when calling CreateTextObject(). (V10.0)

#ATTRADJUSTY:
This does the same as #ATTRADJUSTX (see above) but returns the vertical adjustment pixels for this text object. (V10.0)

The following attributes can be queried for #TIMEOUT:

#ATTRDURATION:
Returns the timeout duration of this timeout object in milliseconds. (V4.5)

#ATTRFUNCTION:
Returns the callback function associated with the specified timeout object. (V4.5)

#ATTRUSERDATA:
Returns the user data associated with this timeout object. (V4.5)

The following attributes can be queried for #TIMER:

#ATTRCOUNT:
Returns how many timer objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

#ATTRELAPSE:
Returns the timer's elapse threshold. (V9.0)

The following attributes can be queried for #UDPOBJECT:

#ATTRCOUNT:
Returns how many UDP objects are currently in memory. Useful for keeping track of the resources used by your script. (V5.0)

The following attributes can be queried for #VECTORPATH:

#ATTRCOUNT:
Returns how many vector path objects there are currently in memory. Useful for tracking memory consumption. (V5.0)

The following attributes can be queried for #VIDEO:

#ATTRWIDTH:
Returns width of the video. (V5.0)

#ATTRHEIGHT:
Returns height of the video. (V5.0)

#ATTRDURATION:
Returns the total video duration in milliseconds. (V5.0)

#ATTRPOSITION:
Returns the current position of a playing or paused video in milliseconds. (V5.0)

#ATTRFORMAT:
Returns the video format name as a string. (V5.0)

#ATTRNUMFRAMES:
Returns the number of frames of this video. Please note that this is often an approximation because it would take too much time to do a precise calculation of all frames in a video stream. This can also return 0 if the video codec does not support frame calculation. (V5.0)

#ATTRCOUNT:
Returns how many videos there are currently in memory. Useful for tracking memory consumption. (V5.0)

#ATTRCANSEEK:
Returns whether or not SeekVideo() can be used on this video object. (V5.0)

#ATTRDRIVER:
Returns the driver used for this video. See ForceVideoDriver for details. This is obsolete since Hollywood 6.0. Use #ATTRLOADER instead. (V5.1)

#ATTRPLAYING:
Returns True if this video is currently playing. (V6.0)

#ATTRPAUSED:
Return True if this video is currently paused. (V6.0)

#ATTRSCALEWIDTH:
Returns the current scale width set for the video using SetVideoSize(). (V6.0)

#ATTRSCALEHEIGHT:
Returns the current scale height set for the video using SetVideoSize(). (V6.0)

#ATTRSCALEMODE:
Returns the current scale mode set for the video using SetVideoSize(). (V6.0)

#ATTRLOADER:
Returns the name of the loader that was used to load this video. (V6.0)

Inputs
obj
type of object to query (see list above)
id
object identifier
attr
which information to return
param
optional: additional parameter required by some attributes (see above)
Results
info
the information you wanted
Example
width = GetAttribute(#DISPLAY, 0, #ATTRWIDTH)
The above code queries the display for its current width. As there is only one display, you do not have to specify an id.

Show TOC