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

Hello everyone i have an overlay i am trying to put onscreen and i have got it to display but it displays multiple of the image on screen and i just want it to display one image.Any ideas?

p.s my image is 256x256 if that helps.

 

Heres the code

 

 

import org.lwjgl.opengl.GL11;

 

import com.Looke81.BioWarfare.BioWarfare;

import com.Looke81.BioWarfare.DrawB;

import com.Looke81.BioWarfare.DrawM;

import com.Looke81.BioWarfare.blocks.BacteriaTest;

import com.Looke81.BioWarfare.items.Microscope;

 

import cpw.mods.fml.common.eventhandler.EventPriority;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import net.minecraft.client.Minecraft;

import net.minecraft.client.gui.Gui;

import net.minecraft.client.gui.GuiChat;

import net.minecraft.client.gui.ScaledResolution;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.util.ResourceLocation;

 

public class OverlayGui extends Gui{

public static OverlayGui instance = new OverlayGui();

private static Minecraft mc = Minecraft.getMinecraft();

private ResourceLocation MOverlay = new ResourceLocation(BioWarfare.modid + ":textures/gui/MOverlay.png");

@SubscribeEvent (priority = EventPriority.LOWEST)

public void RenderGameOverlayEvent(net.minecraftforge.client.event.RenderGameOverlayEvent event) {

 

ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

      int Width = sr.getScaledWidth();

      int Height = sr.getScaledHeight();

   

 

      GL11.glPushMatrix();

 

this.mc.renderEngine.bindTexture(MOverlay);

 

// texture

this.drawTexturedModalRect(0, 0, 0, 0, Width, Height);

 

    GL11.glPopMatrix();

   

}

}

 

BioWarfare Mod: http://goo.gl/BYWQty

Did you register the class that contains the @SubscribeEvent? If so, show where you registered it.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

I pretty sure the resource location is working as i can see the texture. I've removed the push and pop Im not sure why I did that but i saw it in other peoples code so i did it to be safe.My texture is 256x256. Also I've kept the event the same because I'm not sure what event i should use if i just want it to display all the time when in game. I think the problem is with scaled resolution because when i use scaled resolution it fills the screen repeating the image from left to right but if i don't use scaled resolution and instead tell it its 256x256 then it displays one image in the top left that is 256x256. I have tried changing this so that the one image will fill the whole screen but it doesn't seem to work the only time i can fill the screen is when i use scaled resolution but it just repeats the image. 

 

So what im asking is how do i fill the screen with one image and what even should i use to display all the time?

BioWarfare Mod: http://goo.gl/BYWQty

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.