Jump to content

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

From Flowcode Help
No edit summary
No edit summary
Line 66: Line 66:


{{Fcfile|DisplayManagerExample.fcfx|Display Manager Example}}
{{Fcfile|DisplayManagerExample.fcfx|Display Manager Example}}




Line 71: Line 73:
==Macro reference==
==Macro reference==


===MoveObject===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 99: Line 102:




===ShiftObject===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 127: Line 131:




===DrawObject===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 145: Line 150:




===ScaleObject===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 173: Line 179:




===RedrawAll===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 186: Line 193:




===SetObjectText===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 214: Line 222:




===CreateObject===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-

Revision as of 11:51, 3 February 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.

Display Manager Example



Macro reference

MoveObject

MoveObject
Moves an existing object to absolute coordinates on the screen. 
- UINT ObjectID
 
- UINT X
 
- UINT Y
 
- VOID Return


ShiftObject

ShiftObject
Shifts an existing object coordinates on the screen relative to the previous coordinates. 
- UINT ObjectID
 
- INT X
 
- INT Y
 
- VOID Return


DrawObject

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. 
- UINT ObjectID
 
- VOID Return


ScaleObject

ScaleObject
Changes the width and height of the selected Object 
- UINT ObjectID
 
- UINT Width
 
- UINT Height
 
- VOID Return


RedrawAll

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


SetObjectText

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. 
- UINT ObjectID
 
- STRING Text
 
- BYTE Font
 
- VOID Return


CreateObject

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



Property reference

Properties
LinkTo
 
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.