Difference between revisions of "ISKernel:display (Data Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
 +
The data type for display information.
  
 
== Members ==
 
== Members ==
*[[DataType:string|string]] System
+
*[[DataType:string|string]] '''System''': Name of the current display system (e.g. Direct3D9)
*[[DataType:bool|bool]] Windowed
+
*[[DataType:bool|bool]] '''Windowed''': TRUE if the application is ''really'' windowed
*[[DataType:bool|bool]] AppWindowed
+
*[[DataType:bool|bool]] '''AppWindowed''': TRUE if the application ''thinks'' it is windowed
*[[DataType:int|int]] Width
+
*[[DataType:int|int]] '''Width''': The game's actual resolution width
*[[DataType:int|int]] Height
+
*[[DataType:int|int]] '''Height''': The game's actual resolution height
*[[DataType:int|int]] X
+
*[[DataType:int|int]] '''X''': X position of the full window's left edge
*[[DataType:int|int]] Y
+
*[[DataType:int|int]] '''Y''': Y position of the full window's top edge
*[[DataType:int|int]] WindowWidth
+
*[[DataType:int|int]] '''WindowWidth''': Width of the full window
*[[DataType:int|int]] WindowHeight
+
*[[DataType:int|int]] '''WindowHeight''': Height of the full window
*[[DataType:int|int]] Monitor
+
*[[ISKernel:monitor (Data Type)|monitor]] '''Monitor''': Monitor assigned to the application
*[[DataType:int|int]] DesktopWidth
+
*[[ISKernel:monitor (Data Type)|monitor]] '''Monitor['''#''']''': The #th monitor attached to the system (1-based)
*[[DataType:int|int]] DesktopHeight
+
*[[DataType:int|int]] '''Monitors''': Number of monitors
*[[DataType:int|int]] ViewableX
+
*[[DataType:int|int]] '''DesktopWidth''': Width of the windows desktop on the current monitor
*[[DataType:int|int]] ViewableY
+
*[[DataType:int|int]] '''DesktopHeight''': Height of the windows desktop on the current monitor
*[[DataType:int|int]] ViewableWidth
+
*[[DataType:int|int]] '''ViewableX''': X position of the left edge of the window's viewable portion (does not include the border, etc)
*[[DataType:int|int]] ViewableHeight
+
*[[DataType:int|int]] '''ViewableY''': Y position of the top edge of the window's viewable portion (does not include the border, etc)
*[[DataType:bool|bool]] Foreground
+
*[[DataType:int|int]] '''ViewableWidth''': Width of the window's viewable portion
*[[DataType:int|int]] DesktopX
+
*[[DataType:int|int]] '''ViewableHeight''': Height of the window's viewable portion
*[[DataType:int|int]] DesktopY
+
*[[DataType:bool|bool]] '''Foreground''': TRUE if the window is currently the active window on the system
*[[DataType:rgb|rgb]] GetPixel
+
*[[DataType:int|int]] '''DesktopX''': X position of the left edge of the windows desktop on the current monitor
*[[DataType:string|string]] PixelSearch
+
*[[DataType:int|int]] '''DesktopY''': Y position of the top edge of the windows desktop on the current monitor
*[[DataType:int|int]] TextureMem
+
*[[DataType:rgb|rgb]] '''GetPixel['''x''','''y''']''': Retrieves color information of a specific pixel. Coordinates are relative to the viewable portion of the window, not the game's actual display mode
 +
*[[DataType:int|int]] '''TextureMem''': Available texture memory, in megabytes
 +
*[[DataType:float|float]] '''FPS''': Sustained frames per second (calculated from the last 64 frames)
 +
*[[ISSession:hudelement (Data Type)|hudelement]] '''HUDElement['''name''']''': Retrieves the HUD element with the given name
 +
*[[DataType:string|string]] '''PixelSearch''': See [[Inner_Space:Pixel_Search]] for more information.
 +
*[[ISKernel:gdiwindow (Data Type)|GDIWindow]] '''Window''':
 +
 
 
== Methods ==
 
== Methods ==
''(none)''
+
*'''AddHUDElement['''name''','''x''','''y''','''text''']''': Adds a HUD element with a given name, at the given x,y position in pixels (0,0 being upper left corner), with the given text
 +
 
 
== Returns ==
 
== Returns ==
 
+
Same as '''System'''
 
== Examples ==
 
== Examples ==
 +
===Add a HUD element showing current FPS===
 +
*Display:AddHUDElement[FPS,0,0,\${Display.FPS}]
 +
: Adds a HUD element displaying the current sustained FPS.  The ${ is "escaped" so that it will be parsed when it is time to draw the HUD, rather than immediately
 +
=== Display WindowWidth===
 +
*Echo WindowWidth:${Display.WindowWidth}
 +
;Output
 +
Window Width:1032
 +
===Obtain color of the pixel at 150,175===
 +
*echo Pixel Color: ${Display.GetPixel[150,175]}
 +
;Output
 +
Pixel Color: 000033
 +
===Create a HUD element showing current window size===
 +
*Display:AddHUDElement[WindowSize,25,25,\${Display.WindowWidth}x\${Display.WindowHeight}]
  
 
== See Also ==
 
== See Also ==
* [[LavishScript:Data Types|LavishScript Data Types]]
+
*[[LavishScript:Data Types|Data Types]]
* [[IS:Session#Data_Types|Inner Space Session Data Types]]
+
*[[IS:Kernel#Data_Types|Kernel Data Types]]
 +
 
 +
 
 +
{{DT-Stub}}
 +
 
 +
[[Category:Inner Space]]
 +
[[Category:Inner Space Kernel]]
 +
[[Category:Inner Space Kernel Data Types]]

Latest revision as of 08:24, 4 February 2009

Description

The data type for display information.

Members

  • string System: Name of the current display system (e.g. Direct3D9)
  • bool Windowed: TRUE if the application is really windowed
  • bool AppWindowed: TRUE if the application thinks it is windowed
  • int Width: The game's actual resolution width
  • int Height: The game's actual resolution height
  • int X: X position of the full window's left edge
  • int Y: Y position of the full window's top edge
  • int WindowWidth: Width of the full window
  • int WindowHeight: Height of the full window
  • monitor Monitor: Monitor assigned to the application
  • monitor Monitor[#]: The #th monitor attached to the system (1-based)
  • int Monitors: Number of monitors
  • int DesktopWidth: Width of the windows desktop on the current monitor
  • int DesktopHeight: Height of the windows desktop on the current monitor
  • int ViewableX: X position of the left edge of the window's viewable portion (does not include the border, etc)
  • int ViewableY: Y position of the top edge of the window's viewable portion (does not include the border, etc)
  • int ViewableWidth: Width of the window's viewable portion
  • int ViewableHeight: Height of the window's viewable portion
  • bool Foreground: TRUE if the window is currently the active window on the system
  • int DesktopX: X position of the left edge of the windows desktop on the current monitor
  • int DesktopY: Y position of the top edge of the windows desktop on the current monitor
  • rgb GetPixel[x,y]: Retrieves color information of a specific pixel. Coordinates are relative to the viewable portion of the window, not the game's actual display mode
  • int TextureMem: Available texture memory, in megabytes
  • float FPS: Sustained frames per second (calculated from the last 64 frames)
  • hudelement HUDElement[name]: Retrieves the HUD element with the given name
  • string PixelSearch: See Inner_Space:Pixel_Search for more information.
  • GDIWindow Window:

Methods

  • AddHUDElement[name,x,y,text]: Adds a HUD element with a given name, at the given x,y position in pixels (0,0 being upper left corner), with the given text

Returns

Same as System

Examples

Add a HUD element showing current FPS

  • Display:AddHUDElement[FPS,0,0,\${Display.FPS}]
Adds a HUD element displaying the current sustained FPS. The ${ is "escaped" so that it will be parsed when it is time to draw the HUD, rather than immediately

Display WindowWidth

  • Echo WindowWidth:${Display.WindowWidth}
Output
Window Width:1032

Obtain color of the pixel at 150,175

  • echo Pixel Color: ${Display.GetPixel[150,175]}
Output
Pixel Color: 000033

Create a HUD element showing current window size

  • Display:AddHUDElement[WindowSize,25,25,\${Display.WindowWidth}x\${Display.WindowHeight}]

See Also