-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsertionPointCursor.cpp
More file actions
46 lines (40 loc) · 984 Bytes
/
Copy pathInsertionPointCursor.cpp
File metadata and controls
46 lines (40 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Created by jonng on 4/11/2021.
//
#include "InsertionPointCursor.h"
InsertionPointCursor::InsertionPointCursor() {
disable();
setFont(Fonts::getFont(Fonts::MILKY_NICE));
setFillColor(sf::Color::White);
setCharacterSize(40);
}
void InsertionPointCursor::enable() {
is_enabled = true;
}
void InsertionPointCursor::disable() {
is_enabled = false;
setString(' ');
}
void InsertionPointCursor::update() {
if (is_enabled) {
if(the_clock.getElapsedTime().asMilliseconds() > 500) {
setString(' ');
}
if(the_clock.getElapsedTime().asMilliseconds() > 1000) {
setString('|');
the_clock.restart();
}
}
}
float InsertionPointCursor::getTopY() const {
return top_y;
}
void InsertionPointCursor::setTopY(float topY) {
top_y = topY;
}
float InsertionPointCursor::getLeftX() const {
return left_x;
}
void InsertionPointCursor::setLeftX(float leftX) {
left_x = leftX;
}