Feral Heart

Help & Guidance => Game Help => Topic started by: Nightstar on May 05, 2016, 01:57:10 pm

Title: Transparent cursor texture?
Post by: Nightstar on May 05, 2016, 01:57:10 pm
Hai it's me again xD
Feels like I'm asking too much, but I just started all that coding and designing and yeh.. x3
So this time I tried to make that big arrow, that shows up when you click somewhere for your char to run to, transparent.
I changed the file called cursorTex.jpg to a transparent .png file, and transliteratet the jpg to png in the media-materials-Cursor Folder.
As always, I failed and now that arrow is black.
Anyone knows how to make it transparent/invisible?
Title: Re: Transparent cursor texture?
Post by: Hakumi on May 05, 2016, 04:03:09 pm
I tried looking this up to see if I could be mistaken on this but really little to nothing came up about this. I would assume that you would open the cursor ( edit with GIMP or whatever program you use ) and made sure that it was on a checkered background and erased the cursor before proceeding to save as a .PNG there might be a file that in the main folder that has the cursor saved and you might need to change it ( Could be wrong ). But if not you could always simply hide your cursor by pressing 'Tab' I think and then 'C' to open your chat window, 'V' to get your map up again, etc. etc.
Title: Re: Transparent cursor texture?
Post by: Ruby1234 on May 06, 2016, 09:34:25 pm
Assuming the new cursorTex is a transparent .png, then add the line alpha_rejection greater_equal 128 above the texture_unit line.

Full new code:
Code: [Select]
material cursorMat
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
env_map spherical
texture cursorTex.png
}
}
}
}
Title: Re: Transparent cursor texture?
Post by: Shazadah on May 07, 2016, 04:32:59 am
Just adding on to what Phloxen said, try this code if the one above doesn't work (I have a transparent cursor myself). It's just a couple of extra lines added, no big change:

Code: [Select]
material cursorMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
env_map spherical
texture cursorTex.png
}
}
}
}
[/color][/size][/size]
Title: Re: Transparent cursor texture?
Post by: Ruby1234 on May 07, 2016, 02:30:32 pm
Already tested mine in-game. cx

The cull lines don't serve a purpose in transparency typically, they affect how faces are rendered.
Which, if you're trying to make all the faces disappear, aren't needed.
Title: Re: Transparent cursor texture?
Post by: Nightstar on May 10, 2016, 07:34:23 pm
Thanks for those codes cx I tried them, but now it's white instead of black xD
And I gotta correct myself, I'm not trying to get the cursor transparent, but the big arrow that appears whenever you click somewhere with your cursor. I just thought it's the same because the texture files of that arrow are called cursorTex.
Is it even possible to make it transparent?
Title: Re: Transparent cursor texture?
Post by: Hakumi on May 10, 2016, 07:46:35 pm
I don't think I have ever seen it done before so maybe there really isn't a way to make that arrow transparent in the game ( Could be wrong and maybe I didn't look harder or overlooked it ) but so far, nothing.
Title: Re: Transparent cursor texture?
Post by: Bloo. on May 10, 2016, 08:34:36 pm
What art program are you using? And perhaps try saving the file as .jpg rather than .png, like the original file.
Title: Re: Transparent cursor texture?
Post by: Nightstar on May 10, 2016, 09:25:38 pm
Art program is gimp and paint tool as, I tried both. And I think if I save them as .jpg, it won't stay transparent..
Title: Re: Transparent cursor texture?
Post by: PrettyReckless on May 10, 2016, 09:26:48 pm
In order to save something you want to be transparent, it indeed does have to be .png
Title: Re: Transparent cursor texture?
Post by: Ruby1234 on May 10, 2016, 09:43:05 pm
Thanks for those codes cx I tried them, but now it's white instead of black xD
And I gotta correct myself, I'm not trying to get the cursor transparent, but the big arrow that appears whenever you click somewhere with your cursor. I just thought it's the same because the texture files of that arrow are called cursorTex.
Is it even possible to make it transparent?

Mine is currently, transparent, so I'm not sure why yours isn't working...
it is a .png and you changed it to a .png in the code, yes?

I mean, if you want proof it's possible, here's me clicking to move with no cursor showing up:
(https://i.gyazo.com/41b6413701caea22c24b76cdab338be7.gif)

So it must be something on your end...

EDIT:
Are you certain you've made actual transparency? GIMP works differently than SAI for this. By default, jpgs are flattened and will erase to white, yeah?

(https://i.gyazo.com/477c09331279d31600d03a6440fec017.png)

So did you add transparency to the layer in order to erase the image to the actual transparency squares, not white?

(https://i.gyazo.com/8d2775c44b55d12d636ec78bda92c254.png)

(https://i.gyazo.com/999cad66dcc0b8380993afad036ee06e.png)
Title: Re: Transparent cursor texture?
Post by: Nightstar on May 11, 2016, 10:25:43 am
It finally works!
I did the same on my Windows pc, and there it worked. I'm not sure but I guess mac somehow messed up the material codes before.
Thanks for all that effort Phloxenfree, it helped a lot! :3
Title: Re: Transparent cursor texture?
Post by: Ruby1234 on May 11, 2016, 12:18:39 pm
It finally works!
I did the same on my Windows pc, and there it worked. I'm not sure but I guess mac somehow messed up the material codes before.
Thanks for all that effort Phloxenfree, it helped a lot! :3
Anytime! Glad you got it working. c:
Title: Re: Transparent cursor texture?
Post by: Warriorstrike on May 11, 2016, 04:21:59 pm
Locking this up for you as you have found how to get it working. Have fun with it!