Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Filtered Image Effects in Slick?  (Read 809 times)
0 Members and 1 Guest are viewing this topic.
Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Posted 2013-01-16 21:33:24 »

Hey guys,

I was wondering... does Slick have any libraries for adding effects to images along the lines of drop shadow or glow?

I used pulpcore prior to slick, and pulpcore had something along the lines of:

1  
2  
3  
4  
5  
6  
// -- creates a default glow and default drop shadow, and adds effects to image i.
Glow g = new Glow();
DropShadow s = new DropShadow();
FilterChain f = new FilterChain(g,s);
Image i = new Image("someimage.png",x,y);
i.setFilter(f);


Thanks,


-Pickle Smiley

Offline davedes
« Reply #1 - Posted 2013-01-16 21:55:42 »

Nope, it doesn't.

Your best bet is to bake the glow into textures.

If you really need dynamic glows, you should look into shaders. Slick includes some features for shaders, and you can find examples in the wiki and in the forums.

However, I'd suggest learning shaders with a proper framework rather than hacking things in Slick. See here:
https://github.com/mattdesl/lwjgl-basics/wiki

Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #2 - Posted 2013-01-16 22:12:37 »

Nope, it doesn't.

Your best bet is to bake the glow into textures.

If you really need dynamic glows, you should look into shaders. Slick includes some features for shaders, and you can find examples in the wiki and in the forums.

However, I'd suggest learning shaders with a proper framework rather than hacking things in Slick. See here:
https://github.com/mattdesl/lwjgl-basics/wiki

This makes me a saaaad panda.

Oh well, thanks for getting back to me! It saved me quite a bit of time searching Smiley


-Pickle

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2013-01-16 22:18:58 »

Shaders aren't really that hard to learn... Smiley

Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #4 - Posted 2013-01-17 18:43:30 »

shaders don't look too hard to learn Smiley

One other question though... if I make a .png in photoshop and there's semi-transparent pixels, they show up as white pixels in the game... is there a way to have those transparent pixels appear as transparent pixels, and not as white pixels?

Thanks again,


-Pickle

Offline sproingie

JGO Kernel


Medals: 202



« Reply #5 - Posted 2013-01-18 01:57:17 »

Did you save the alpha channel with the PNG?  Photoshop has some funny defaults about that sort of thing.
Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #6 - Posted 2013-01-18 19:46:19 »

Did you save the alpha channel with the PNG?  Photoshop has some funny defaults about that sort of thing.


I'm not sure even how to check if I did. I'll look into it though...

Thanks Sproingie Smiley


-Pickle

Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #7 - Posted 2013-01-19 05:24:28 »

Yup, it was because I was saving the image as png 8 (which reduced the file size) and as such didn't save the alpha values Smiley

Thanks again Sproingie! You saved me a ton of time Cheesy


-Pickle

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (32 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (58 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!