Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.simsilica.lemur.*;
- import com.simsilica.lemur.Button.ButtonAction;
- import com.simsilica.lemur.component.*;
- // lemur-proto import
- import com.jme3.material.RenderState.BlendMode;
- def gradient = TbtQuadBackgroundComponent.create(
- texture( name:"/com/simsilica/lemur/icons/bordered-gradient.png",
- generateMips:false ),
- 1, 1, 1, 126, 126,
- 1f, false );
- def bevel = TbtQuadBackgroundComponent.create(
- texture( name:"/com/simsilica/lemur/icons/bevel-quad.png",
- generateMips:false ),
- 0.125f, 8, 8, 119, 119,
- 1f, false );
- def border = TbtQuadBackgroundComponent.create(
- texture( name:"/com/simsilica/lemur/icons/border.png",
- generateMips:false ),
- 1, 1, 1, 6, 6,
- 1f, false );
- def border2 = TbtQuadBackgroundComponent.create(
- texture( name:"/com/simsilica/lemur/icons/border.png",
- generateMips:false ),
- 1, 2, 2, 6, 6,
- 1f, false );
- // lemur-proto def
- def transparent = new QuadBackgroundComponent(color(0, 0, 0, 0))
- def doubleGradient = new QuadBackgroundComponent( color(0.5, 0.75, 0.85, 0.5) );
- doubleGradient.texture = texture( name:"/com/simsilica/lemur/icons/double-gradient-128.png",
- generateMips:false )
- selector( "custom" ) {
- fontSize = 14
- }
- selector( "label", "custom" ) {
- insets = new Insets3f( 2, 2, 0, 2 );
- color = color(0.5, 0.75, 0.75, 0.85)
- }
- selector( "container", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- }
- selector( "slider", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- }
- def pressedCommand = new Command<Button>() {
- public void execute( Button source ) {
- if( source.isPressed() ) {
- source.move(1, -1, 0);
- } else {
- source.move(-1, 1, 0);
- }
- }
- };
- def stdButtonCommands = [
- (ButtonAction.Down):[pressedCommand],
- (ButtonAction.Up):[pressedCommand]
- ];
- selector( "title", "custom" ) {
- color = color(0.8, 0.9, 1, 0.85f)
- highlightColor = color(1, 0.8, 1, 0.85f)
- shadowColor = color(0, 0, 0, 0.75f)
- shadowOffset = new com.jme3.math.Vector3f(2, -2, -1);
- background = new QuadBackgroundComponent( color(0.5, 0.75, 0.85, 0.5) );
- background.texture = texture( name:"/com/simsilica/lemur/icons/double-gradient-128.png",
- generateMips:false )
- insets = new Insets3f( 2, 2, 2, 2 );
- buttonCommands = stdButtonCommands;
- }
- selector( "button", "custom" ) {
- background = gradient.clone()
- color = color(0.8, 0.9, 1, 0.85f)
- background.setColor(color(0, 0.75, 0.75, 0.5))
- insets = new Insets3f( 2, 2, 2, 2 );
- buttonCommands = stdButtonCommands;
- }
- selector( "slider", "custom" ) {
- insets = new Insets3f( 1, 3, 1, 2 );
- }
- selector( "slider", "button", "custom" ) {
- background = doubleGradient.clone()
- background.setColor(color(0.5, 0.75, 0.75, 0.5))
- insets = new Insets3f( 0, 0, 0, 0 );
- }
- selector( "slider.thumb.button", "custom" ) {
- text = "[]"
- color = color(0.6, 0.8, 0.8, 0.85)
- }
- selector( "slider.left.button", "custom" ) {
- text = "-"
- background = doubleGradient.clone()
- background.setColor(color(0.5, 0.75, 0.75, 0.5))
- background.setMargin(5, 0);
- color = color(0.6, 0.8, 0.8, 0.85)
- }
- selector( "slider.right.button", "custom" ) {
- text = "+"
- background = doubleGradient.clone()
- background.setColor(color(0.5, 0.75, 0.75, 0.5))
- background.setMargin(4, 0);
- color = color(0.6, 0.8, 0.8, 0.85)
- }
- selector( "checkbox", "custom" ) {
- def on = new IconComponent( "/com/simsilica/lemur/icons/Glass-check-on.png", 1f,
- 0, 0, 1f, false );
- on.setColor(color(0.5, 0.9, 0.9, 0.9))
- on.setMargin(5, 0);
- def off = new IconComponent( "/com/simsilica/lemur/icons/Glass-check-off.png", 1f,
- 0, 0, 1f, false );
- off.setColor(color(0.6, 0.8, 0.8, 0.8))
- off.setMargin(5, 0);
- onView = on;
- offView = off;
- color = color(0.8, 0.9, 1, 0.85f)
- }
- selector( "rollup", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- }
- selector( "tabbedPanel", "custom" ) {
- activationColor = color(0.8, 0.9, 1, 0.85f)
- }
- selector( "tabbedPanel.container", "custom" ) {
- background = null
- }
- selector( "tab.button", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- color = color(0.4, 0.45, 0.5, 0.85f)
- insets = new Insets3f( 4, 2, 0, 2 );
- buttonCommands = stdButtonCommands;
- }
- // lemur-proto styles
- selector( "optionPanel", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- }
- selector( "optionPanel.container", "custom" ) {
- background = gradient.clone()
- background.color = color(0.25, 0.4, 0.6, 0.25)
- background.setMargin(10, 10)
- insets = new Insets3f( 2, 2, 2, 2 )
- }
- selector( "title.label", "custom" ) {
- color = color(0.8, 0.9, 1, 0.85f)
- highlightColor = color(1, 0.8, 1, 0.85f)
- shadowColor = color(0, 0, 0, 0.75f)
- shadowOffset = new com.jme3.math.Vector3f(2, -2, -1);
- background = new QuadBackgroundComponent( color(0.5, 0.75, 0.85, 0.5) );
- background.texture = texture( name:"/com/simsilica/lemur/icons/double-gradient-128.png",
- generateMips:false )
- insets = new Insets3f( 2, 2, 2, 2 );
- }
- selector( "list.container", "custom" ) {
- background = gradient.clone()
- background.setColor(color(0.25, 0.5, 0.5, 0.5))
- insets = new Insets3f( 2, 2, 2, 2, 2, 2 );
- }
- selector( "list.item", "custom" ) {
- color = color(0.5, 0.75, 0.75, 0.85)
- background = transparent;
- }
- selector( "list.selector", "custom" ) {
- background = gradient.clone();
- background.color = color(0.4, 0.6, 0.6, 0.5)
- //background.material.material.additionalRenderState.blendMode = BlendMode.Exclusion;
- background.material.material.additionalRenderState.blendMode = BlendMode.AlphaAdditive;
- }
- selector( "colorChooser.value", "custom" ) {
- border = gradient.clone()
- border.setColor(color(0.25, 0.5, 0.5, 0.5))
- insets = new Insets3f( 2, 2, 2, 2, 2, 2 );
- }
- selector( "colorChooser.colors", "custom" ) {
- border = gradient.clone()
- border.setColor(color(0.25, 0.5, 0.5, 0.5))
- insets = new Insets3f( 2, 2, 2, 2, 2, 2 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement