Difference between revisions of "Component: Display Manager (Graphical Library)"

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Lib_DisplayManager.fcfx FC_Comp_Source_Lib_DisplayManager.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Lib_DisplayManager.fcfx FC_Comp_Source_Lib_DisplayManager.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Lib_DisplayManager.fcfx FC_Comp_Source_Lib_DisplayManager.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Lib_DisplayManager.fcfx FC_Comp_Source_Lib_DisplayManager.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 46: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 60: Line 64:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveObject'''
 +
|-
 +
| colspan="2" | Moves an existing object to absolute coordinates on the screen. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectID
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | X
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ShiftObject'''
 +
|-
 +
| colspan="2" | Shifts an existing object coordinates on the screen relative to the previous coordinates. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectID
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 +
| width="90%" | X
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DrawObject'''
 +
|-
 +
| colspan="2" | Draws a single object onto the display without clearing the display. Doesn't draw a textfield component, this is done using the SetObjectText macro. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectID
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ScaleObject'''
 +
|-
 +
| colspan="2" | Changes the width and height of the selected Object 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectID
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Width
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Height
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RedrawAll'''
 +
|-
 +
| colspan="2" | Redraws all the content from the display manager objects. Doesn't draw textfield components, this is done using the SetObjectText macro. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetObjectText'''
 +
|-
 +
| colspan="2" | Assigns text to a single line text object and draws directly to the display. Blanks the selected area first to ensure nothing from previous text is left behind. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectID
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Text
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Font
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateObject'''
 +
|-
 +
| colspan="2" | Define an object on the graphical LCD. Returns the Object ID. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | ObjectType
 +
|-
 +
| colspan="2" | 0=TextBox, 1=Rect, 2=Line, 3=Ellipse, 4=FilledEllipse, 5=FilledRect 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | X
 +
|-
 +
| colspan="2" | X Pixel Coordinate 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" | Y Pixel Coordinate 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Width
 +
|-
 +
| colspan="2" | Pixel Width or X Radius 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Height
 +
|-
 +
| colspan="2" | Pixel Height or Y Radius 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
 +
 +
==Property reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | LinkTo
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Max Objects
 +
|-
 +
| colspan="2" | The total number of objects allowed on the screen. Sets the size of the RAM buffers used to track the various screen elements. 
 +
|}==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 09:58, 27 January 2023

Author MatrixTSL
Version 1.0
Category Graphical Library


Display Manager component

A component designed to simplify the process of drawing primitives and text onto a graphical display. Keeps track of coordinates so you don't have to. Also works great as a base layer for gLCD based games as it will check for collisions and perform movement.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Lib_DisplayManager.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Lib_DisplayManager.fcfx

Detailed description

The component can create the follow objects.

  • Type_Line - 2 - A simple straight line.
  • Type_Rectangle - 1 - A simple rectangular box.
  • Type_RectangeFilled - 5 - A filled rectangular box.
  • Type_Ellipse - 3 - A simple ellipse or circle.
  • Type_EllipseFilled - 4 - A filled ellipse or circle.
  • Type_TextBox - 0 - A text area allowing a line of text to be displayed.


The type can be entered by using the component's public constants. Begin with the Display Manager handle name followed by :: and the list of the public variables will be displayed.

For example... DisplayManager1::Type_TextBox

Examples

An example showing the creation of some text areas inside formatted shapes.

FC6 Icon.png Display Manager Example

Macro reference

Fc9-comp-macro.png MoveObject
Moves an existing object to absolute coordinates on the screen. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT X
 
Fc9-u16-icon.png - UINT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftObject
Shifts an existing object coordinates on the screen relative to the previous coordinates. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-s16-icon.png - INT X
 
Fc9-s16-icon.png - INT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png DrawObject
Draws a single object onto the display without clearing the display. Doesn't draw a textfield component, this is done using the SetObjectText macro. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScaleObject
Changes the width and height of the selected Object 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT Width
 
Fc9-u16-icon.png - UINT Height
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RedrawAll
Redraws all the content from the display manager objects. Doesn't draw textfield components, this is done using the SetObjectText macro. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetObjectText
Assigns text to a single line text object and draws directly to the display. Blanks the selected area first to ensure nothing from previous text is left behind. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-string-icon.png - STRING Text
 
Fc9-u8-icon.png - BYTE Font
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CreateObject
Define an object on the graphical LCD. Returns the Object ID. 
Fc9-u16-icon.png - UINT ObjectType
0=TextBox, 1=Rect, 2=Line, 3=Ellipse, 4=FilledEllipse, 5=FilledRect 
Fc9-u16-icon.png - UINT X
X Pixel Coordinate 
Fc9-u16-icon.png - UINT Y
Y Pixel Coordinate 
Fc9-u16-icon.png - UINT Width
Pixel Width or X Radius 
Fc9-u16-icon.png - UINT Height
Pixel Height or Y Radius 
Fc9-u16-icon.png - UINT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-21-icon.png Max Objects
The total number of objects allowed on the screen. Sets the size of the RAM buffers used to track the various screen elements. 

==Macro reference==

Fc9-comp-macro.png MoveObject
Moves an existing object to absolute coordinates on the screen. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT X
 
Fc9-u16-icon.png - UINT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftObject
Shifts an existing object coordinates on the screen relative to the previous coordinates. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-s16-icon.png - INT X
 
Fc9-s16-icon.png - INT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png DrawObject
Draws a single object onto the display without clearing the display. Doesn't draw a textfield component, this is done using the SetObjectText macro. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScaleObject
Changes the width and height of the selected Object 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT Width
 
Fc9-u16-icon.png - UINT Height
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RedrawAll
Redraws all the content from the display manager objects. Doesn't draw textfield components, this is done using the SetObjectText macro. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetObjectText
Assigns text to a single line text object and draws directly to the display. Blanks the selected area first to ensure nothing from previous text is left behind. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-string-icon.png - STRING Text
 
Fc9-u8-icon.png - BYTE Font
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CreateObject
Define an object on the graphical LCD. Returns the Object ID. 
Fc9-u16-icon.png - UINT ObjectType
0=TextBox, 1=Rect, 2=Line, 3=Ellipse, 4=FilledEllipse, 5=FilledRect 
Fc9-u16-icon.png - UINT X
X Pixel Coordinate 
Fc9-u16-icon.png - UINT Y
Y Pixel Coordinate 
Fc9-u16-icon.png - UINT Width
Pixel Width or X Radius 
Fc9-u16-icon.png - UINT Height
Pixel Height or Y Radius 
Fc9-u16-icon.png - UINT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-21-icon.png Max Objects
The total number of objects allowed on the screen. Sets the size of the RAM buffers used to track the various screen elements. 

==Macro reference==

Fc9-comp-macro.png MoveObject
Moves an existing object to absolute coordinates on the screen. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT X
 
Fc9-u16-icon.png - UINT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftObject
Shifts an existing object coordinates on the screen relative to the previous coordinates. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-s16-icon.png - INT X
 
Fc9-s16-icon.png - INT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png DrawObject
Draws a single object onto the display without clearing the display. Doesn't draw a textfield component, this is done using the SetObjectText macro. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScaleObject
Changes the width and height of the selected Object 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT Width
 
Fc9-u16-icon.png - UINT Height
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RedrawAll
Redraws all the content from the display manager objects. Doesn't draw textfield components, this is done using the SetObjectText macro. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetObjectText
Assigns text to a single line text object and draws directly to the display. Blanks the selected area first to ensure nothing from previous text is left behind. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-string-icon.png - STRING Text
 
Fc9-u8-icon.png - BYTE Font
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CreateObject
Define an object on the graphical LCD. Returns the Object ID. 
Fc9-u16-icon.png - UINT ObjectType
0=TextBox, 1=Rect, 2=Line, 3=Ellipse, 4=FilledEllipse, 5=FilledRect 
Fc9-u16-icon.png - UINT X
X Pixel Coordinate 
Fc9-u16-icon.png - UINT Y
Y Pixel Coordinate 
Fc9-u16-icon.png - UINT Width
Pixel Width or X Radius 
Fc9-u16-icon.png - UINT Height
Pixel Height or Y Radius 
Fc9-u16-icon.png - UINT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-21-icon.png Max Objects
The total number of objects allowed on the screen. Sets the size of the RAM buffers used to track the various screen elements. 

==Macro reference==

Fc9-comp-macro.png MoveObject
Moves an existing object to absolute coordinates on the screen. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT X
 
Fc9-u16-icon.png - UINT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftObject
Shifts an existing object coordinates on the screen relative to the previous coordinates. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-s16-icon.png - INT X
 
Fc9-s16-icon.png - INT Y
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png DrawObject
Draws a single object onto the display without clearing the display. Doesn't draw a textfield component, this is done using the SetObjectText macro. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScaleObject
Changes the width and height of the selected Object 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-u16-icon.png - UINT Width
 
Fc9-u16-icon.png - UINT Height
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RedrawAll
Redraws all the content from the display manager objects. Doesn't draw textfield components, this is done using the SetObjectText macro. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetObjectText
Assigns text to a single line text object and draws directly to the display. Blanks the selected area first to ensure nothing from previous text is left behind. 
Fc9-u16-icon.png - UINT ObjectID
 
Fc9-string-icon.png - STRING Text
 
Fc9-u8-icon.png - BYTE Font
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CreateObject
Define an object on the graphical LCD. Returns the Object ID. 
Fc9-u16-icon.png - UINT ObjectType
0=TextBox, 1=Rect, 2=Line, 3=Ellipse, 4=FilledEllipse, 5=FilledRect 
Fc9-u16-icon.png - UINT X
X Pixel Coordinate 
Fc9-u16-icon.png - UINT Y
Y Pixel Coordinate 
Fc9-u16-icon.png - UINT Width
Pixel Width or X Radius 
Fc9-u16-icon.png - UINT Height
Pixel Height or Y Radius 
Fc9-u16-icon.png - UINT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-21-icon.png Max Objects
The total number of objects allowed on the screen. Sets the size of the RAM buffers used to track the various screen elements.