(August 2016) Monthly WIP screenshot thread

Got a new ComboBox up in Lemur. Similar to the RollupPanel except that when it is expanded the popup panel isn’t part of the layout so it appears on top of items below the ComboBox in the layout rather than moving them down. Each item added to the ComboBox menu can be specified to fill the width of the menu and whether it should be left, center or right aligned. Also added in an ImageBox Element that just displays a texture and, by default, maintains the original aspect ratio of the image when it is resized by the layout. Plus dynamic spacers can be inserted between Elements to take up excess space.

The background panel for the ComboBox menu has a CursorEventControl that just consumes mouse clicks to prevent items behind it from receiving the event.

https://drive.google.com/open?id=0B6BscJ4Cq-K7ZUlJakxKZFRiTGs

6 Likes

Nice. This one is high on my to-do list also. I have two in-game implementations already that I wasn’t happy enough with to move to proto. Nice to see someone elses.

You’re welcome to take a look at mine, I uploaded LemurDynamo-Beta2 to that link. Also got around to styling the progress-bar :wink:

Plus did a little touching up on the H/VBoxLayouts. Originally I thought that setting the Element to expand and/or fill width/height should override setPreferredSize(), but I changed my mind and figure setPreferredSize() should be the overriding setting.

Advent theme for LemurDynamo

4 Likes

Is this theme (or other themes beside glass theme) available? looks cool :smile:

You have to use a modified version of Lemur I’m working on called LemurDynamo. You can grab Beta3 from my Google Drive here: https://drive.google.com/open?id=0B6BscJ4Cq-K7ZUlJakxKZFRiTGs

I just uploaded it so the Advent theme is available. The reason I’m making themes is to give examples on how to use the new styling options. Aside from the Checkbox the Advent theme does not use any images, it uses GradientBackgroundComponents which work similar to styling buttons and such for Android or web pages. You define a radius for the corners, a border size and gradients for the inner portion and border portion. You can also rotate the border and/or inner gradients for diagonal designs.

When adding gradients to GradientBackgroundComponent you use the ColorStop class.

GradientBackgroundComponent.setInnerColors(new ColorStop(new ColorRGBA(1, 1, 1, 1), 0f), new ColorStop(new ColorRGBA(0, 0, 0, 1), 1f));

will produce a gradient on the interior of the background that fades from white at the bottom to black at the top. The second argument to ColorStop is the position of the color along the gradient. 0.0 is the bottom of the background, 1.0 is the top, 0.5 is the middle. When adding colors to the gradient you must add them in ascending order from 0.0 to 1.0 which is from bottom to top.

You can fade between up to 8 colors on the interior and 4 for the border. Don’t worry if you accidentally add more than 8 or 4, those will just be discarded. When adding border colors you must specify in the ColorStop that it is a border color by specifying true as the third argument to ColorStop:

BackgroundGradientComponent.setBorderColors(new ColorStop(ColorRGBA.Blue), 0.0, true);

produces a solid blue border so long as GradientBackgroundComponent.seBordertThickness() is greater than 0, if not then the color doesn’t matter because there’s no border.

I haven’t gone through and commented GradientBackgroundComponent a whole lot yet. You can set the radius of the edges with GradientBackgroundComponent.setRadius() and interior gradients can be radial with GradientBackgroundComponent.setRadialGradient(true) there’s also GradientBackgroundComponent.setRadialGradientPos(float x, float y) to set the center of the gradient circle, 0.5, 0.5 is the center of the background, and GradientBackgroundComponent.setRadialGradientScale(float x, float y) to scale the inner gradient.

P.S. LemurDynamo requires all the normal Lemur dependencies plus jME-TrueTypeFont available on my site at http://1337atr.weebly.com/jttf.html

P.P.S. The radius of the corners will scale if the width/height of the resulting background is not large enough to accommodate the radius. For instance if you put in a radius of 10 and the resulting width/height of the background is 4x4 then the radius will scale down to 2, 2+2=4. If/when the background grows larger it will scale the radius back up until it it reaches 10. This helps for creating circles. If you want a circular edge just specify a large radius like 1000000.

Here’s an example. Once you get LemurDynamo up and running add the following to your simpleInitApp:

getViewPort().setBackgroundColor(ColorRGBA.White);
GuiGlobals.initialize(this);
BaseStyles.loadAdventStyle();
GuiGlobals.getInstance().getStyles().setDefaultStyle("advent");

Container myWindow = new Container(new VBoxLayout(5, FillMode.Even, false));
guiNode.attachChild(myWindow);
myWindow.setLocalTranslation(100, 450, 0);

ComboBox cb = new ComboBox();
cb.addItems("Item 1", "Item 2", "Item 3", "Item 4");
myWindow.addChild(cb, false, false);

DropDown dd = new DropDown("Drop Down");
dd.addItems(VBoxLayout.HAlign.Center, false, new Label("Define"), new Label("Individual Alignment"));
dd.addItem(new Label("1"), VBoxLayout.HAlign.Left, false);
dd.addItem(new Label("2"), VBoxLayout.HAlign.Right, false);
dd.addItem(new Label("3"), VBoxLayout.HAlign.Center, false);
dd.addItem(new Spacer(new Vector3f(348, 0, 0)));

Container c = new Container(new HBoxLayout(0, FillMode.First, false));
c.addChild(new Label("Spacer ->"), false, false);
c.addChild(new Spacer(), false, true);
c.addChild(new Label("<- Spacer"), false, false);
dd.addItem(c, true);

dd.setMargins(0);
myWindow.addChild(dd, false, false);

ProgressBar pb = new ProgressBar();
pb.setMessage("Progress");
pb.setProgressPercent(0.6);
myWindow.addChild(pb, false, true);

c = new Container(new HBoxLayout(15, FillMode.Last, true));
c.addChild(new Label("Slider:"), false, false);

Slider slider = new Slider();
c.addChild(slider, true, true);
myWindow.addChild(c, false, true);

Checkbox checkBox = new Checkbox("Checkbox");
myWindow.addChild(checkBox);

Styles styles = GuiGlobals.getInstance().getStyles();
Attributes attrs = styles.getSelector("textField", "advent");
attrs.set("singleLine", false);
TextField tf = new TextField("Hello Word");
tf.setPreferredLineCount(4);
tf.setPreferredWidth(256);
myWindow.addChild(tf);

Button clickMe = myWindow.addChild(new Button("Button"));
clickMe.addClickCommands(source -> System.out.println("The World is Mine."));

TabbedPanel tp = new TabbedPanel();
tp.addTab("Tab 1", new Label("Tab 1"));
tp.addTab("Tab 2", new Label("Tab 2"));
myWindow.addChild(tp, true, false);
5 Likes

Essentia is here again :3

(Click on image to see in 4k)

13 Likes

What are you using for your shadow shader ?

Another test for the jpony plugin. Alpha 1.0 is almost here.

6 Likes

It is basic shader from jme

It looks really good. What type of light renderer / filter are you using ? I was having problems with the directional light filter and directional light renderer.

I guess my colleague made few changes to shader, but on the base it is just DirectionalLightShadowRenderer

That is what I’m using but the default one misses a lot of spatial volume. Any possibility you can share ?

I’m not sure I understand what is your problem. Do you mean it does not support alpha on textures? Because it is what we modified in this.

I think that is the problem. I have some trees where the leaves are draw o them with transparency. The shader ignores the whole polygon if it has alpha , at least I’m assuming. I don’t now enough about shaders to make the changes my self.

Yeah, jme’s shadow shader supports alpha channel strangely (why it hasn’t been fixed yet? 0_o) I am currently fixing some stuff in shadows and can share code afterwards in a few days.

I fixed an issue related to this this afternoon, what version are you using?

1 Like

Whatever version comes with this …

well then I fixed that issue this afternoon.

2 Likes

While we’re on the issue of the shadow renderer , why is there no setEnabled feature ? All of the other filters have the enable option but the directional light shadow render.