Examples of bindText()


Examples of org.terasology.rendering.nui.widgets.UILabel.bindText()

            }
        });

        UILabel debugLine1 = find("debugLine1", UILabel.class);
        if (debugLine1 != null) {
            debugLine1.bindText(new TimedBinding<String>(0.5f, new ReadOnlyBinding<String>() {
                @Override
                public String get() {
                    double memoryUsage = ((double) Runtime.getRuntime().totalMemory() - (double) Runtime.getRuntime().freeMemory()) / 1048576.0;
                    return String.format("fps: %.2f, mem usage: %.2f MB, total mem: %.2f MB, max mem: %.2f MB",
                            time.getFps(), memoryUsage, Runtime.getRuntime().totalMemory() / 1048576.0, Runtime.getRuntime().maxMemory() / 1048576.0);
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UILabel.bindText()

            }));
        }

        UILabel debugLine2 = find("debugLine2", UILabel.class);
        if (debugLine2 != null) {
            debugLine2.bindText(new ReadOnlyBinding<String>() {
                @Override
                public String get() {
                    return String.format("Active Entities: %s, Current Target: %s", entityManager.getActiveEntityCount(), cameraTarget.toString());
                }
            });
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UILabel.bindText()

            });
        }

        UILabel debugLine3 = find("debugLine3", UILabel.class);
        if (debugLine3 != null) {
            debugLine3.bindText(new ReadOnlyBinding<String>() {
                @Override
                public String get() {
                    Vector3f pos = localPlayer.getPosition();
                    CharacterComponent character = localPlayer.getCharacterEntity().getComponent(CharacterComponent.class);
                    float yaw = (character != null) ? character.yaw : 0;
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UILabel.bindText()

            });
        }

        UILabel debugLine4 = find("debugLine4", UILabel.class);
        if (debugLine4 != null) {
            debugLine4.bindText(new ReadOnlyBinding<String>() {
                @Override
                public String get() {
                    String biomeId = "unavailable";
                    Vector3i blockPos = new Vector3i(localPlayer.getPosition());
                    if (worldProvider.isBlockRelevant(blockPos)) {
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UILabel.bindText()

                }
            });
        }
        UILabel saveStatusLabel = find("saveStatusLabel", UILabel.class);
        if (saveStatusLabel != null) {
            saveStatusLabel.bindText(new ReadOnlyBinding<String>() {
                @Override
                public String get() {
                    return "Saving... ";
                }
            });
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UIText.bindText()

                scrollArea.moveToBottom();
            }
        });

        final UIText history = find("messageHistory", UIText.class);
        history.bindText(new ReadOnlyBinding<String>() {
            @Override
            public String get() {
                StringBuilder messageList = new StringBuilder();
                Iterator<Message> messageIterator = console.getMessages().iterator();
                while (messageIterator.hasNext()) {
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UIText.bindText()

    @Override
    public void initialise() {
        UIText nametext = find("playername", UIText.class);
        if (nametext != null) {
            nametext.bindText(BindHelper.bindBeanProperty("name", config.getPlayer(), String.class));
        }

        Color color = config.getPlayer().getColor();

        img = find("image", UIImage.class);
View Full Code Here

Examples of org.terasology.rendering.nui.widgets.UIText.bindText()

        previewImage = find("preview", UIImage.class);

        UIText seed = find("seed", UIText.class);
        if (seed != null) {
            seed.bindText(seedBinding);
        }

        layerDropdown = find("display", UIDropdown.class);
        layerDropdown.bindOptions(new ReadOnlyBinding<List<String>>() {
            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.