The Monitor class represents a stage monitor.
More...
#include <scratchcpp/monitor.h>
The Monitor class represents a stage monitor.
◆ Mode
| Enumerator |
|---|
| Default | |
| Large | |
| Slider | |
| List | |
◆ Monitor() [1/2]
| Monitor::Monitor |
( |
const std::string & | id, |
|
|
const std::string & | opcode ) |
◆ Monitor() [2/2]
| libscratchcpp::Monitor::Monitor |
( |
const Monitor & | | ) |
|
|
delete |
◆ autoPosition()
| void Monitor::autoPosition |
( |
const std::vector< std::shared_ptr< Monitor > > & | allMonitors | ) |
|
Auto-positions the monitor with the other monitors.
- Note
- Call this only when the monitor size is known.
◆ block()
| std::shared_ptr< Block > Monitor::block |
( |
| ) |
const |
Returns the block used to get the monitor's value.
◆ changeValue()
| void Monitor::changeValue |
( |
const Value & | newValue | ) |
|
Calls the monitor's value update function. For example a variable monitor's function sets the value of the monitored variable.
- Note
- This doesn't work with list monitors.
◆ discrete()
| bool Monitor::discrete |
( |
| ) |
const |
Returns true if the monitor's slider allows only integer values.
◆ extension()
◆ height()
| unsigned int Monitor::height |
( |
| ) |
const |
Returns the monitor's height.
◆ id()
| const std::string & Entity::id |
( |
| ) |
const |
|
inherited |
◆ mode()
Returns the monitor's mode.
◆ name()
| const std::string & Monitor::name |
( |
| ) |
const |
◆ needsAutoPosition()
| bool Monitor::needsAutoPosition |
( |
| ) |
const |
Returns true if the monitor needs auto positioning. The renderer should call autoPosition() as soon as it knows the monitor size.
◆ opcode()
| const std::string & Monitor::opcode |
( |
| ) |
const |
◆ script()
| std::shared_ptr< Script > Monitor::script |
( |
| ) |
const |
Returns the script which holds information about the monitor's compiled block.
◆ setDiscrete()
| void Monitor::setDiscrete |
( |
bool | discrete | ) |
|
Sets whether the monitor's slider allows only integer values.
◆ setExtension()
| void Monitor::setExtension |
( |
IExtension * | extension | ) |
|
Sets the extension this monitor belongs to.
◆ setHeight()
| void Monitor::setHeight |
( |
unsigned int | height | ) |
|
Sets the monitor's height.
◆ setId()
| void Entity::setId |
( |
const std::string & | newId | ) |
|
|
inherited |
◆ setInterface()
Sets the monitor interface.
◆ setMode()
| void Monitor::setMode |
( |
Mode | mode | ) |
|
◆ setName()
| void Monitor::setName |
( |
const std::string & | name | ) |
|
Sets the name of this monitor.
◆ setScript()
| void Monitor::setScript |
( |
std::shared_ptr< Script > | script | ) |
|
Sets the script which holds information about the monitor's compiled block.
◆ setSliderMax()
| void Monitor::setSliderMax |
( |
double | sliderMax | ) |
|
Sets the maximum value of the monitor's slider.
◆ setSliderMin()
| void Monitor::setSliderMin |
( |
double | sliderMin | ) |
|
Sets the minimum value of the monitor's slider.
◆ setSprite()
| void Monitor::setSprite |
( |
Sprite * | sprite | ) |
|
Convenience method which calls block()->setTarget().
◆ setValueChangeFunction()
Sets the function which is called to change the monitor's value.
- See also
- changeValue()
◆ setVisible()
| void Monitor::setVisible |
( |
bool | visible | ) |
|
Sets whether the monitor is visible or not.
◆ setWidth()
| void Monitor::setWidth |
( |
unsigned int | width | ) |
|
Sets the monitor's width.
◆ setX()
| void Monitor::setX |
( |
int | x | ) |
|
Sets the monitor's x-coordinate.
◆ setY()
| void Monitor::setY |
( |
int | y | ) |
|
Sets the monitor's y-coordinate.
◆ sliderMax()
| double Monitor::sliderMax |
( |
| ) |
const |
Returns the maximum value of the monitor's slider.
◆ sliderMin()
| double Monitor::sliderMin |
( |
| ) |
const |
Returns the minimum value of the monitor's slider.
◆ sprite()
| Sprite * Monitor::sprite |
( |
| ) |
const |
Convenience method which calls block()->target().
◆ updateValue()
| void Monitor::updateValue |
( |
const Value & | value | ) |
|
Notifies the monitor's interface about value change. The interaface is supposed to read it from the VirtualMachine.
◆ visible()
| bool Monitor::visible |
( |
| ) |
const |
Returns true if the monitor is visible.
◆ width()
| unsigned int Monitor::width |
( |
| ) |
const |
Returns the monitor's width.
◆ x()
Returns the monitor's x-coordinate.
◆ y()
Returns the monitor's y-coordinate.
◆ Engine
The documentation for this class was generated from the following files: