Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I am making a new kind of GUI in minecraft, it is the gui of a laptop and it is meant to simulate windows 7 as much as possible, but with out the clunky MC built in buttons, but instead, I have the background dynamically changing while the player clicks the screen(so if its between point x,y,z, and w, its on the icon for the web application, switch to that screen), but, the GUI texture is slightly dependent on the dmenisions of the game screen(so the HD texture can fit in smaller screens), is there a way to calculate the position of the mouse when clicked, on the texture? like taking the expression from the drawGuicontianerBackground() method((this.width - xSize)/2), and somehow use that to calclate position on the texture, like 0,0 being in the top left corner of the texture, not the screen. Like maybe for texture posistion 50,50,

   if(((this.width - xSize)/2 + 50) == mouseX && (this.height - ySize)/2 + 50) == mouseY)
   {
       this.party();
   }

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Hi

 

It sounds like you just need to be able to convert your mouseClicked coordinate back into the texture coordinate?

 

texture_x = mouseclick_x * texture_width / this.width;

texture_y = mouseclick_y * texture_height / this.height;

 

You know texture_width and texture_height because you're supplying the texture, yes?

 

-TGG

  • Author

Yes. However the texture does change size depending on screen size, in order to fit. But since i update the xSize and ySize varaibles when scaling, it should be fine unless the player clicks in the first tick.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.