|
11 | 11 |
|
12 | 12 | import java.util.ArrayList;
|
13 | 13 |
|
| 14 | +import org.polyfrost.polyui.color.PolyColor; |
14 | 15 | import org.polyfrost.polyui.component.Drawable;
|
15 | 16 | import org.polyfrost.polyui.component.impl.Block;
|
16 | 17 | import org.polyfrost.polyui.component.impl.Image;
|
| 18 | +import org.polyfrost.polyui.component.impl.Text; |
17 | 19 | import org.polyfrost.polyui.event.MouseClicked;
|
| 20 | +import org.polyfrost.polyui.input.Translator; |
18 | 21 | import org.polyfrost.polyui.layout.Layout;
|
19 | 22 | import org.polyfrost.polyui.layout.impl.FlexLayout;
|
| 23 | +import org.polyfrost.polyui.property.impl.BlockProperties; |
| 24 | +import org.polyfrost.polyui.property.impl.TextProperties; |
20 | 25 | import org.polyfrost.polyui.renderer.data.PolyImage;
|
21 | 26 | import org.polyfrost.polyui.renderer.impl.GLWindow;
|
22 | 27 | import org.polyfrost.polyui.renderer.impl.NVGRenderer;
|
|
25 | 30 |
|
26 | 31 | public class JavaTest {
|
27 | 32 | public static void main(String[] args) {
|
28 |
| -// GLWindow window = new GLWindow("Java Window", 800, 800); |
29 |
| -// ArrayList<Drawable> things = new ArrayList<>(50); |
30 |
| -// for (int i = 0; i < 51; i++) { // creates 50 rectangles with random sizes |
31 |
| -// int finalI = i; |
32 |
| -// things.add(new Block(Units.flex(), new Vec2<>(Units.pixels(Math.random() * 40 + 40), Units.pixels(Math.random() * 40 + 40)), new MouseClicked(0).to(component -> { |
33 |
| -// System.out.println("Mouse clicked! " + finalI); |
34 |
| -// }), new MouseClicked(0, 2).to(component -> { |
35 |
| -// System.out.println("Mouse double-clicked! " + finalI); |
36 |
| -// }), new MouseClicked(1).to(component -> { |
37 |
| -// System.out.println("Mouse right clicked! " + finalI); |
38 |
| -// }))); |
39 |
| -// } |
40 |
| -// PolyUI polyUI = new PolyUI("", new NVGRenderer(window.getWidth(), window.getHeight()), Layout.drawables( |
41 |
| - //new Text(PolyTranslator.localised("Java... rainbow! and image"), Units.pixels(32), Units.times(Units.pixels(20), Units.pixels(570))), |
42 |
| -// new Block(new BlockProperties(new Color.Gradient(new Color(1f, 0f, 0f), new Color(0f, 1f, 1f))), Units.times(Units.pixels(20), Units.pixels(600)), Units.times(Units.pixels(120), Units.pixels(120))), |
43 |
| -// new Block(new BlockProperties(new Color.Chroma(Units.seconds(5))), Units.times(Units.pixels(200), Units.pixels(600)), Units.times(Units.pixels(120), Units.pixels(120))), |
44 |
| -// new Image(new PolyImage("/s.png", 120, 120), Units.times(Units.pixels(380), Units.pixels(600))), |
45 |
| -// new FlexLayout(Units.times(Units.pixels(20), Units.pixels(30)), Units.percent(80), things.toArray(new Drawable[50])))); |
46 |
| -// window.open(polyUI); |
| 33 | + //GLWindow window = new GLWindow("Java Window", 800, 800); |
| 34 | + //ArrayList<Drawable> things = new ArrayList<>(50); |
| 35 | + //for (int i = 0; i < 51; i++) { // creates 50 rectangles with random sizes |
| 36 | + // int finalI = i; |
| 37 | + // things.add(new Block(Units.flex(), new Vec2<>(Units.pixels(Math.random() * 40 + 40), Units.pixels(Math.random() * 40 + 40)), new MouseClicked(0).to(component -> { |
| 38 | + // System.out.println("Mouse clicked! " + finalI); |
| 39 | + // }), new MouseClicked(0, 2).to(component -> { |
| 40 | + // System.out.println("Mouse double-clicked! " + finalI); |
| 41 | + // }), new MouseClicked(1).to(component -> { |
| 42 | + // System.out.println("Mouse right clicked! " + finalI); |
| 43 | + // }))); |
| 44 | + //} |
| 45 | + //PolyUI polyUI = new PolyUI("", new NVGRenderer(window.getWidth(), window.getHeight()), Layout.drawables( |
| 46 | + // new Text(new TextProperties(), Translator.localised("Java... rainbow! and image"), Units.pixels(32), Units.times(Units.pixels(20), Units.pixels(570))), |
| 47 | + // new Block(new BlockProperties(), Units.times(Units.pixels(20), Units.pixels(600)), Units.times(Units.pixels(120), Units.pixels(120))), |
| 48 | + // new Block(new BlockProperties(), Units.times(Units.pixels(200), Units.pixels(600)), Units.times(Units.pixels(120), Units.pixels(120))), |
| 49 | + // new Image(new PolyImage("/s.png", 120, 120), Units.times(Units.pixels(380), Units.pixels(600))), |
| 50 | + // new FlexLayout(Units.times(Units.pixels(20), Units.pixels(30)), Units.percent(80), things.toArray(new Drawable[50])))); |
| 51 | + //window.open(polyUI); |
47 | 52 | }
|
48 | 53 | }
|
0 commit comments