-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSelector.cpp
More file actions
34 lines (31 loc) · 829 Bytes
/
Selector.cpp
File metadata and controls
34 lines (31 loc) · 829 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
#include "Selector.h"
void Selector::setup(ofRectangle rect, int index){
font.loadFont("Abel-Regular.ttf", 24);
selecting=false;
selected=0;
myIndex=index;
for(int i=0; i<9; i++){
rects[i]=ofRectangle(rect.x,(rect.height/9)*i,rect.width,rect.height/9);
}
list.setup();
}
void Selector::draw(){
for(int i=0; i<9; i++){
ofPushStyle();
if(i==selected){
ofSetHexColor(0xFF6600);
ofFill();
ofRect(rects[i]);
}else{
ofNoFill();
ofSetColor(200);
ofRect(rects[i]);
ofSetColor(200,200,200,30);
ofFill();
ofRect(rects[i]);
}
ofPopStyle();
ofSetColor(255);
font.drawString(list.files[myIndex][i],rects[i].x+10,rects[i].y+40);
}
}