I need for somebody to help me make a gui with the following info hope it isnt to hard...
- GUI ( with area for my text to go talking about the options )
- Two buttons and when u tap the button it sets my variable to true for which ever they click like
[Button 1]
On click - sets exp = true;
[Button 2]
On click - sets exp2 =true;
- Input !
This will allow the user to input his name after he choices a button and this will create a var ( var name = the name of input) so i can do during the mod Hello " name" welocme to such and such !
Thank you for reading hope Beatz or a good gui maker can help please !
Input = area to putthe name and a ok button ! and it sets it on a var so i can do this !
clientMessage("Welcone" + name + " to this mod");and that comes up after you pick your button option ! and how do i set once u open the map this gui pops up with the two button options
?
BeATz_UnKNoWN I keep going to your gui script templates but the long parts of the templates are cut off. Could you make a new thread with the templates on it.
BeATz_UnKNoWN I keep going to your gui script templates but the long parts of the templates are cut off. Could you make a new thread with the templates on it.
If a line of code is long on GitHub, the rest appears invisible. Scroll to the bottom of code snippet/template and use the scroller.
- GUI ( with area for my text to go talking about the options )
- Two buttons and when u tap the button it sets my variable to true for which ever they click like
[Button 1]
On click - sets exp = true;
[Button 2]
On click - sets exp2 =true;
- Input !
This will allow the user to input his name after he choices a button and this will create a var ( var name = the name of input) so i can do during the mod Hello " name" welocme to such and such !
Thank you for reading hope Beatz or a good gui maker can help please !
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 1"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ exp = true; } })); layout.addView(button); var button1 = new android.widget.Button(ctx); button1.setText("Button 2"); button1.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ exp2 = true; } })); layout.addView(button1); 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; } }})); }Your wish came true. BeATz_UnKNoWN has helped.I don't really understand what you mean about the input part, though.
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]
lol
clientMessage("Welcone" + name + " to this mod");and that comes up after you pick your button option ! and how do i set once u open the map this gui pops up with the two button options
?
Oh, ok. I will make and PM you the JS file when I go on my laptop.
Yeah, I realised that.
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]
What same project?
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]
var GUI; var exp = false; var exp2 = false; var name = ""; function dip2px(dips){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density); } 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); var scroll = new android.widget.ScrollView(ctx); var layout1 = new android.widget.LinearLayout(ctx); layout.setOrientation(1); layout1.setOrientation(1); scroll.addView(layout); layout1.addView(scroll); var params = new android.widget.LinearLayout.LayoutParams(android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT); params.leftMargin = dip2px(5); var text = new android.widget.TextView(ctx); text.setTextSize(16); text.setText("Your Text Here"); text.setLayoutParams(params); layout.addView(text); var button = new android.widget.Button(ctx); button.setText("Button 1"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ exp = true; } })); layout.addView(button); var button1 = new android.widget.Button(ctx); button1.setText("Button 2"); button1.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ exp2 = true; } })); layout.addView(button1); var nameSelection = new android.widget.EditText(ctx); nameSelection.setHint("Name"); nameSelection.setInputType(android.text.InputType.TYPE_CLASS_TEXT); layout.addView(nameSelection); var button2 = new android.widget.Button(ctx); button2.setText("Button 3"); button2.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ name = nameSelection.getText(); GUI.dismiss(); clientMessage("Welcome " + name + "!"); } })); layout.addView(button2); GUI = new android.widget.PopupWindow(layout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight()); GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK)); 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; } }})); }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]
Enchantments?
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]
If a line of code is long on GitHub, the rest appears invisible. Scroll to the bottom of code snippet/template and use the scroller.
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]