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,

 

I've recently started modding again, and I'm having an issue: I need to create a custom particle with a texture that I can specify via the constructor.

 

So far, I've achieved some different results:

  • I had particles working with floating etc. however only textures with one color were displayed correctly. A texure with a gradient (black to red) was displayed as half-transparent dark gray and a texture with transparency did not display at all.
  • I then looked at how the footstep particle worked and adjusted my code, and voila, all particles were displayed; however only the one with only a single color was displayed without transparency. The one with transpaHello,
     
    I've recently started modding again, and I'm having an issue: I need to create a custom particle with a texture that I can specify via the constructor.
     
    So far, I've achieved some different results:
    • I had particles working with floating etc. however only textures with one color were displayed correctly. A texure with a gradient (black to red) was displayed as half-transparent dark gray and a texture with transparency did not display at all.
    • I then looked at how the footstep particle worked and adjusted my code, and voila, all particles were displayed; however only the one with only a single color was displayed without transparency. The one with transparency was displayed, but it also was half-transparent (it is not in the original texture). Additionally, the particles displayed like the footstep particle and were flat (they didn't face the player), which was probably a result of modelling my particle after the footstep one.

     

    I also have made some research, but most tutorials are outdated (<1.5) or only help with creating a particle with the shape of an existing one.

     

    I'd appreciate any help.

     

    Regards

    -Quicksteverency was displayed, but it also was half-transparent (it is not in the original texture). Additionally, the particles displayed like the footstep particle and were flat (they didn't face the player), which was probably a result of modelling my particle after the footstep one.

 

I also have made some research, but the tutorials I found were outdated (<1.5) or only helped with creating a particle with the shape of an existing one (by setting the RGB values).

 

I'd appreciate any help.

 

Regards

-Quicksteve

  • 4 weeks later...

Since it's been so long without any replies, anything may be useful, so, I don't know if it changed in 1.8, but particle textures are masks, white is fully visible, black is fully transparent, and you apply color via the RGB values in the EntityFX derived class.  I don't know about the other stuff though, in 1.7.10 you could just put a ResourceLocation in the constructor arguments.

 

 

Maybe this will help?  1.7.10 EntityFX

Since it's been so long without any replies, anything may be useful, so, I don't know if it changed in 1.8.

It didn't change much in 1.8. Some methods of Tessellator is moved to WorldRenderer. And GL11.blabla is replaced by GLStateManager.blabla.

getFXLayer is the key of custom particles. In order to use custom textures, it should return 3.

GLStateManager.enableAlpha makes textures transparent when rendered.

 

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

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.