This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
var GUI; function newLevel(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ try{ var layout = new android.widget.LinearLayout(ctx); layout.setOrientation(1); var button = new android.widget.Button(ctx); button.setText("Button"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code; } })); layout.addView(button); GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT); GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT)); GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0); }catch(err){ print("An error occured: " + err); } }})); } function leaveGame(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ if(GUI != null){ GUI.dismiss(); GUI = null; } }})); }
Quote from BeATz_UnKNoWN This layout will work for first idea, but I recommend using a Dialog for the second.
Input: ItemId
Amount: Amount
[ button ] // says give
What gui do i use this ?
var GUI; function newLevel(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ try{ var layout = new android.widget.LinearLayout(ctx); layout.setOrientation(1); var button = new android.widget.Button(ctx); button.setText("Button"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code; } })); layout.addView(button); GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT); GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT)); GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0); }catch(err){ print("An error occured: " + err); } }})); } function leaveGame(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ if(GUI != null){ GUI.dismiss(); GUI = null; } }})); }Check out my sites -> http://bukkitpe.tk , http://diamondlogic.tk
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Can you post code for my second one , the input one , u tap the button hte input box comes up u put the id and amount in and it adds it
plz
Check out my sites -> http://bukkitpe.tk , http://diamondlogic.tk