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.

[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?

Featured Replies

  • Author
10 minutes ago, diesieben07 said:

Your offsets are probably wrong. Or your texture is not actually 265 pixels but 256 pixels in size (I would hope it is 256 pixels).

As I said earlier, I'm using vanilla textures as a placeholder atm.
I looked around the values carefully and here's how it's rendering the colors:
1. It renders in the empty boss bar background by getting the ordinal of the color from the enum, multiplying it by 5 and then multiplying it by 2 which in my case results in 40 aka the texture starts at the 40th pixel.
2. It renders in the filled texture by doing the exact same calculation but adding 5. After that it sets it's width to the progress multiplied by 183
My best guess is that the progress isn't updating or something.

Edit: Well, the progress really isn't updating but I doubt that's what's causing the issue.

Edited by uSkizzik

  • Author
5 minutes ago, diesieben07 said:

Then the texture is 256x256, not 265.

Well, that was the issue. Now, what I need is to get the progress going because so far the bar doesn't seem to be updating.
Edit: I just pushed the progress to my repo, here are the links:
Package containing boss events, Packet, RenderGameOverlay

Edited by uSkizzik

  • Author

Well, it's working...
I don't know how and why it didn't work previously but it's working.
Thank you so much @diesieben07 for putting up with my stupidity this whole time and helping me figure this out.

EDIT: Oh we ain't done yet! I will most likely need help on the moving down too!

Edited by uSkizzik

  • Author
16 minutes ago, diesieben07 said:
  1. If you want your boss bars to cooperate with the vanilla rendering, you have to put them into the vanilla events map, not make your own. You can then use RenderGameOverlayEvent.BossInfo to alter the rendering of this custom bar. This is what I told you from the very start.

Alright, I made a customColor field in my LerpingBossEvent and extended the original. Now how do I change the rendering?
I need to change the drawBar but for that I need the k and j values which are set / changed in the for loop.

  • Author

Yea I just cancelled the event and rewrote the bit of the code that was causing me an issue. Probably not the best solution but everything works perfectly.

  • uSkizzik changed the title to [Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?

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.