|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmkv.MyGUI.MyGUIStyle
MyGUIStyle is a simple collection of colours and a font(s) that is used to give a constant look and feel to all elements drawn through processing.
Version: 0.01
Created by John Beech
Website: http://mkv25.net/
MyGUIStyle objects contain many variables used by almost all MyGUI elements.
Each of the variables are public and can be accessed by . syntax, for example:
MyGUIStyle style1 = new MyGUIStyle(this);
PApplet.color back = style1.background;
In the list below, variable names are inside the (brackets).
Field Summary | |
int |
background
|
int |
buttonFace
|
int |
buttonHighlight
|
int |
buttonShadow
|
int |
buttonText
|
int |
disabled
|
int |
face
|
processing.core.PFont |
font
|
int |
fontSize
|
int |
highlight
|
int |
highlightText
|
int |
icon
|
int |
padding
|
int |
scrollBar
|
int |
shadow
|
int |
strokeWeight
|
Constructor Summary | |
MyGUIStyle(processing.core.PApplet root)
The most basic constructor for MyGUIStyle objects. |
|
MyGUIStyle(processing.core.PApplet root,
int tint)
This constructor lets you specify a shade to tint all the colours to. |
|
MyGUIStyle(processing.core.PApplet root,
processing.core.PFont font,
int fontSize,
int buttonFace,
int buttonHighlight,
int buttonShadow,
int buttonText)
This constructor takes inputs for a custom (preloaded) font and a selection of the colours as PApplet.color() values. |
|
MyGUIStyle(processing.core.PApplet root,
processing.core.PFont font,
int fontSize,
int background,
int buttonFace,
int buttonHighlight,
int buttonShadow,
int buttonText,
int icon,
int face,
int highlight,
int shadow,
int disabled,
int highlightText,
int scrollBar)
This constructor takes inputs for a custom (preloaded) font and all of the colours as PApplet.color() values. |
Method Summary | |
MyGUIStyle |
copy()
|
void |
setDefaultColors()
This method sets the colours of this style to the defaults, essentially resetting to a blue layout. |
void |
setFont(processing.core.PFont newFont)
|
void |
setFont(processing.core.PFont newFont,
int newFontSize)
|
void |
setPadding(int pad)
Sets the padding value used to add a spacer between the edge of a MyGUI component such as a button and the internal contents such as text or an icon. |
void |
setStrokeWeight(int weight)
Sets the stroke weights of all lines drawn, this may have the effect of 'beefing up' buttons and causing vector drawn icons to be more chunky then intended. |
void |
setTransparency(float a)
Set transparency sets the value of all the colours used in MyGUI style. |
void |
setTransparency(int a)
Set transparency sets the value of all the colours used in MyGUI style. |
void |
tintColor(int c)
This tint method alters all the colours used in this style based off the hue/shade of the specified color value (c). |
int |
tintColor(int c,
int tint)
This tint method tints a color value based off another color value using the full saturation of the tint colour. |
int |
tintColor(int c,
int tint,
float str)
This tint method tints a color value based off another color value using a custom (strength) of the tint colour. |
void |
tintDefault(int c)
This tint method resets all the colours to the default value and then alters them based off the hue/shade of the specified color value (c). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public processing.core.PFont font
public int fontSize
public int strokeWeight
public int padding
public int background
public int buttonFace
public int buttonHighlight
public int buttonShadow
public int buttonText
public int icon
public int highlight
public int face
public int shadow
public int disabled
public int highlightText
public int scrollBar
Constructor Detail |
public MyGUIStyle(processing.core.PApplet root)
root
- root points back to the processing PApplet used to call the MyGUI library.public MyGUIStyle(processing.core.PApplet root, int tint)
root
- points back to the processing PApplet used to call the MyGUI library.tint
- specifies the color value used to shade the default colours.tintColor(int c)
public MyGUIStyle(processing.core.PApplet root, processing.core.PFont font, int fontSize, int background, int buttonFace, int buttonHighlight, int buttonShadow, int buttonText, int icon, int face, int highlight, int shadow, int disabled, int highlightText, int scrollBar)
root
- points back to the processing PApplet used to call the MyGUI library.font
- preloaded PFont reference to define the font used for text.fontSize
- the size of font to use for elements.background
- the color of background elements.buttonFace
- the color for button faces.buttonHighlight
- the color for highlights on buttons.buttonShadow
- the color for shadows/alternate colours on buttons.buttonText
- the color for text on buttons.icon
- the color for class specific icons.face
- a generic face color.highlight
- a generic highlight color.shadow
- a generic shadow color.disabled
- a color for disabled elements.highlightText
- the color for highlighted text.scrollBar
- the color for the backing of a scroll barpublic MyGUIStyle(processing.core.PApplet root, processing.core.PFont font, int fontSize, int buttonFace, int buttonHighlight, int buttonShadow, int buttonText)
root
- points back to the processing PApplet used to call the MyGUI library.font
- preloaded PFont reference to define the font used for text.fontSize
- the size of font to use for elements.buttonFace
- the color for button faces.buttonHighlight
- the color for highlights on buttons.buttonShadow
- the color for shadows/alternate colours on buttons.buttonText
- the color for text on buttons.Method Detail |
public void setDefaultColors()
public void setFont(processing.core.PFont newFont)
public void setFont(processing.core.PFont newFont, int newFontSize)
public void setStrokeWeight(int weight)
weight
- the new line weight to be set.public void setPadding(int pad)
pad
- the new padding value to use.public void tintColor(int c)
c
- the color value to use for tinting.public void tintDefault(int c)
public int tintColor(int c, int tint)
c
- the base colour that will be tinted.tint
- the colour used for tinting.
tintColor(int c, int tint, float str)
public int tintColor(int c, int tint, float str)
c
- the base colour that will be tinted.tint
- the colour used for tinting.str
- the strength of saturation to be used when tinting.
tintColor(int c, int tint, float str)
public void setTransparency(float a)
a
- alpha / transparency for all colours.public void setTransparency(int a)
a
- alpha / transparency for all colours.public MyGUIStyle copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |