java - Stage don't show up When call -
i'm trying menu option of game i'm creating.
screen use tablelayout can't work.
black screen.
see :
package com.me.mygdxgame; import com.badlogic.gdx.gdx; import com.badlogic.gdx.screen; import com.badlogic.gdx.files.filehandle; import com.badlogic.gdx.graphics.gl20; import com.badlogic.gdx.scenes.scene2d.actor; import com.badlogic.gdx.scenes.scene2d.stage; import com.badlogic.gdx.scenes.scene2d.ui.checkbox; import com.badlogic.gdx.scenes.scene2d.ui.label; import com.badlogic.gdx.scenes.scene2d.ui.skin; import com.badlogic.gdx.scenes.scene2d.ui.table; import com.badlogic.gdx.scenes.scene2d.utils.changelistener; import com.badlogic.gdx.scenes.scene2d.utils.clicklistener; public class bluetoothoptionscreen implements screen{ final stage stage; skin skin; boolean hote = false; table table; public bluetoothoptionscreen() { this.stage = new stage(gdx.graphics.getwidth(), gdx.graphics.getwidth(), true); filehandle skinfile1 = gdx.files.internal("uiskin.json"); skin = new skin(skinfile1); } @override public void render(float delta) { stage.act(delta); gdx.gl.glclear( gl20.gl_color_buffer_bit ); stage.draw(); table.drawdebug(stage); } @override public void resize(int width, int height) { stage.setviewport(width, height, true); } @override public void show() { gdx.input.setinputprocessor( stage ); table = new table(skin); stage.addactor(table); table.setfillparent(true); table.defaults().spacebottom(30); table.add("options").colspan(3); final checkbox hotecheckbox = new checkbox( "", skin ); hotecheckbox.setchecked(true); hotecheckbox.addlistener(new changelistener() { @override public void changed( changeevent event, actor actor ) { boolean enabled = hotecheckbox.ischecked(); hote = enabled; } } ); table.row(); table.add("hote"); table.add(hotecheckbox); } }
i glad, if can me.
Comments
Post a Comment