Graphics Specification

Last modification on 2019-02-04

Introduction

This document briefly explains the graphics functions implemented to create the simulation visualisation and the user interface.

Key Terms and Concepts

TermDescription
Command PromptAn area in the user interface which allows commands to be entered
inner_colorAn argument which represents the fill color of an item to be drawn
ModeThe way the user interface handles key presses
outer_colorAn argument which represents the border color of an item to be drawn
QuadtreeThe data structure which contains all of the agents
StateThe current state of an entity. Living or non-living
text_stringAn argument which represents the text to be written to the screen
XAn argument which represents a position in the x axis of the simulation
YAn argument which represents a position in the y axis of the simulation

Overview

In an attempt to conserve as much computing power as possible for the mechanics of the simulation, the graphics in Ecosim are very simple and utilitarian. All graphical elements are created by 3 very simple primitives, which are as follows:

For a technical specification of each graphical function used in the program, see below.

Graphics functions

Command NameDescriptionArguments
RectangleDraw a rectangle on the screen between the specified x/y1 and x/y2 locations with the supplied inner/outer colorsx1, y1, x2, y2, inner_color, outer_color
PointDraw a single point on the screen at the location specified by x and y and color it with inner_color x, y, inner_color
TextDraw the text_string on the screen at the location specified by x and y and color it with inner_colorx, y, text_string, inner_color

Graphical Elements

Using a combination of the above functions, the following components of the simulation are able to be created:

For a full explanation of the user interface's components and layout, please see the user interface specification.