ofxOui - UI Components for OpenFrameworks

ofxOuiIcon.hpp
Go to the documentation of this file.
1 /*
2  * ofxOuiIcon.hpp
3  *
4  * Jui Icon Box (Wrapper around ofImage)
5  *
6  * This code has been authored by Jules Francoise <jfrancoi@sfu.ca>
7  * during his postdoc contract at Simon Fraser University (MovingStories
8  * project).
9  * See:
10  * http://julesfrancoise.com/
11  * http://movingstories.ca/
12  *
13  * Copyright (C) 2016 Jules Francoise.
14  *
15  * This Source Code Form is subject to the terms of the Mozilla Public
16  * License, v. 2.0. If a copy of the MPL was not distributed with this
17  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
18  */
19 
20 #ifndef ofxOuiIcon_hpp
21 #define ofxOuiIcon_hpp
22 
23 #include "ofxOuiCommon.hpp"
24 
25 namespace ofxOui {
26 
31 class Icon {
32  public:
36  Icon();
37 
41  virtual ~Icon();
42 
46  virtual void update();
47 
51  virtual void draw();
52 
57  virtual void load(string filename);
58 
62  int x = 0;
63 
67  int y = 0;
68 
72  int width = 100;
73 
77  int height = 100;
78 
82  int padding = 10;
83 
88 
92  ofColor color = ofColor::black;
93 
97  ofRectangle rect;
98 
99  protected:
100  ofImage icon_;
101 };
102 }
103 
104 #endif
virtual void draw()
OF-like draw function: draws the icon.
Definition: ofxOuiIcon.cpp:67
Anchor alignment
Alignment.
Definition: ofxOuiIcon.hpp:87
int width
width (of the containing box)
Definition: ofxOuiIcon.hpp:72
virtual void load(string filename)
load the image file
Definition: ofxOuiIcon.cpp:73
int padding
padding (within the containing box)
Definition: ofxOuiIcon.hpp:82
ofImage icon_
Definition: ofxOuiIcon.hpp:100
Icon()
Default Constructor.
Definition: ofxOuiIcon.cpp:22
ofColor color
Color (in case of a binary icon)
Definition: ofxOuiIcon.hpp:92
int height
height (of the containing box)
Definition: ofxOuiIcon.hpp:77
int y
y position (of the containing box)
Definition: ofxOuiIcon.hpp:67
int x
x position (of the containing box)
Definition: ofxOuiIcon.hpp:62
virtual void update()
OF-like update function: updates the position of the icon.
Definition: ofxOuiIcon.cpp:26
Definition: ofxOuiColormap.hpp:25
Icon image box wrapper.
Definition: ofxOuiIcon.hpp:31
ofRectangle rect
Actual rectangle where the icon is drawn.
Definition: ofxOuiIcon.hpp:97
Anchor
Generic Anchor specifier for Text/Image alignment.
Definition: ofxOuiCommon.hpp:57
virtual ~Icon()
Destructor.
Definition: ofxOuiIcon.cpp:24