Skin skin = new Skin(); skin.add("background",temp)
// Create a new skin using the default constructor and // add your fonts to it. Skin skin = new Skin(); skin.add("myFont", myFont, BitmapFont.class); // Remember that this texture atlas is NOT automatically disposed by the skin, // so keep a reference and dispose of it yourself. skin.addRegion(new TextureAtlas("file/location/of/your/atlas"); skin.load(Gdx.files.internal("file/location/of/your/skin"));
Skin theSkin= new Skin(); //Create a button style TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.pressedOffsetY=-4.0f; textButtonStyle.unpressedOffsetY=-4.0f; theSkin.add("default", textButtonStyle); TextButton theButton = new TextButton("New",theSkin);
Skin skin = new Skin(); skin.add( "background", new NinePatch(this.game.manager.get("hud/ninepatchframe.png", Texture.class), 5, 5, 5, 5)); skin.add("cursor", this.game.manager.get("data/cursor.png")); TextFieldStyle tStyle = new TextFieldStyle(); tStyle.font = getDefaultFont(25); //here i get the font tStyle.fontColor = Color.BLACK; tStyle.background = skin.getDrawable("background"); tStyle.cursor = skin.newDrawable("cursor", Color.GREEN); tStyle.cursor.setMinWidth(2f); tStyle.selection = skin.newDrawable("background", 0.5f, 0.5f, 0.5f, 0.5f); this.nameField = new TextField("enter name here", tStyle);
BitmapFont yourBitmapFont = new BitmapFont(); yourBitmapFont.getRegion().getTexture().setFilter(TextureFilter.Linear,TextureFilter.Linear); Skin tileSkin = new Skin(); tileSkin.add("white", new Texture("whatever/image/path")); tileSkin.add("default", new BitmapFont()); TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.up = tileSkin.newDrawable("white"); textButtonStyle.down = tileSkin.newDrawable("white", Color.DARK_GRAY); textButtonStyle.checked = tileSkin.newDrawable("white", Color.LIGHT_GRAY); textButtonStyle.over = tileSkin.newDrawable("white", Color.LIGHT_GRAY); textButtonStyle.font = _yourBitmapFont; tileSkin.add("default", textButtonStyle);
skin.add("texture1", texture1);