GithubHelp home page GithubHelp logo

Comments (3)

nikoliazekter avatar nikoliazekter commented on August 16, 2024

Calling setPresicion invalidates text highlighting if input is greater than max value. Also it doens't matter if I call setPrecision(0) or with any other argument.

from vis-ui.

kotcrab avatar kotcrab commented on August 16, 2024

invalidates text highlighting

So text is deselected? Please provide SSCCE.

from vis-ui.

nikoliazekter avatar nikoliazekter commented on August 16, 2024
package com.nikoliazekter.awesomegame.desktop;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.kotcrab.vis.ui.VisUI;
import com.kotcrab.vis.ui.widget.NumberSelector;

public class TestIssue46 {

    public static void main(String[] args) {
        LwjglApplicationConfiguration c = new LwjglApplicationConfiguration();
        c.width = 1280;
        c.height = 720;
        new LwjglApplication(new TestIssue46Application(), c);
    }

}

class TestIssue46Application extends ApplicationAdapter {
    private Stage stage;

    @Override
    public void create() {
        VisUI.load();
        stage = new Stage(new ScreenViewport());
        Table table = new Table();
        table.setSkin(VisUI.getSkin());
        table.setFillParent(true);
        table.add("Red highlighting appears when input is greater than 200");
        table.row();
        NumberSelector numberSelectorNormal = new NumberSelector("Normal", 100, 0, 200, 1);
        table.add(numberSelectorNormal);
        table.row();
        table.add("No red highlighting appears when input is greater than 200");
        table.row();
        NumberSelector numberSelectorBuggy = new NumberSelector("Buggy", 100, 0, 200, 1);
        numberSelectorBuggy.setPrecision(0);
        table.add(numberSelectorBuggy);
        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
    }

    @Override
    public void resize(int width, int height) {
        stage.getViewport().update(width, height, true);
    }

    @Override
    public void render() {
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        stage.act(Gdx.graphics.getDeltaTime());
        stage.draw();
    }

    @Override
    public void dispose() {
        VisUI.dispose();
        stage.dispose();
    }
}

untitled
untitled1

from vis-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.