Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Blurring the background  (Read 4517 times)

0 Members and 1 Guest are viewing this topic.

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Blurring the background
« on: February 16, 2011, 07:01:37 AM »

Hi,
we're working on our own inventory system. We'd like the background to fade out when I a player opens the inventory (it isn't a problem) and also we'd like the background to be blurred.


Is it possible in the engine? :)
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Blurring the background
« Reply #1 on: February 16, 2011, 08:15:04 AM »

There's no blurring possible directly. All you could do is simply fade into a pre-blurred-version of you background ( overlay as a sprite for example). But you cannot blur the screen in real-time.
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Blurring the background
« Reply #2 on: February 16, 2011, 10:39:47 AM »

We try to do something similar. You haven't mentioned this but I assume you use a window for your inventory. You can create an image with the dimensions of your inventory window (which must match the dimensions of your scene). Set the colour as black (or any colour you wish) and make it transparent (you can achieve this with an image application, we use GIMP). Then you can set it as background of your window and when you open it its transparency might give you the effect you need.
Logged

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Re: Blurring the background
« Reply #3 on: February 16, 2011, 10:58:18 AM »

There's no blurring possible directly. All you could do is simply fade into a pre-blurred-version of you background ( overlay as a sprite for example). But you cannot blur the screen in real-time.
I was afraid there is no simpler way. :-\
Thanks anyway :)

We try to do something similar. You haven't mentioned this but I assume you use a window for your inventory. You can create an image with the dimensions of your inventory window (which must match the dimensions of your scene). Set the colour as black (or any colour you wish) and make it transparent (you can achieve this with an image application, we use GIMP). Then you can set it as background of your window and when you open it its transparency might give you the effect you need.
Yes, we use a window. However, this doesn't blur the background, does it? It just mixes the background with a transparent color (black color for example). So I get traditional alpha-blended color. :)
« Last Edit: February 16, 2011, 11:12:40 AM by Mihulik »
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Blurring the background
« Reply #4 on: February 16, 2011, 11:20:54 AM »

BTW in your screenshot it seems that you have achieved the blurring effect. Is this image modified so you can show us what you need to do?

Well the method I mentioned is ok for our project but if you find a solution that gives a nice blurring effect we might use it too  :)
Logged

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Re: Blurring the background
« Reply #5 on: February 16, 2011, 11:41:43 AM »

BTW in your screenshot it seems that you have achieved the blurring effect. Is this image modified so you can show us what you need to do?

Well the method I mentioned is ok for our project but if you find a solution that gives a nice blurring effect we might use it too  :)
The image is just an example (photoshop-based image) of what we'd like to achieve.
We'll probably prepare pre-blurred backgrounds as Spellbreaker mentioned.
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Blurring the background
« Reply #6 on: February 16, 2011, 11:49:45 AM »

Well that doesn't seem as a very good solution. Yes the result will be exactly what you need but you will have to create a blurred background for EVERY scene where the inventory can be used. Then, whenever the inventory is opened you will need to check in which scene you are and set the proper background for the Inventory window. Or am I talking bull...t?  ???
Logged

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Re: Blurring the background
« Reply #7 on: February 17, 2011, 06:53:06 AM »

Yes, you're almost right. However, it isn't as painful as it may seem. :)
I don't have to check in which scene I am to set the proper background because I can create a close-up layer called "inventory background" in every scene and then in the script opening the inventory does something like:
Code: [Select]
....
var inventoryBgLayer = Scene.GetNode("inventory background");
inventoryBgLayer.Active = true;
...
:)
« Last Edit: February 17, 2011, 06:59:00 AM by Mihulik »
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Blurring the background
« Reply #8 on: February 17, 2011, 09:25:10 AM »

Hmm that is a very good idea. Do you mind if I try to make something similar?
Logged

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Re: Blurring the background
« Reply #9 on: February 18, 2011, 06:02:06 AM »

Of course I do not. ;)
Logged

Prote1n

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 45
    • View Profile
Re: Blurring the background
« Reply #10 on: February 22, 2011, 10:06:40 AM »

You can simulate a blur effect like this

Code: WME Script
  1. var layer = Scene.MainLayer;
  2. var back = Scene.GetNode ("background");
  3. var background2 = layer.InsertEntity (1,"background2");
  4. background2.SetSprite (back.GetSprite());
  5. background2.AlphaColor = MakeRGBA (255,255,255,50);
  6. background2.X = 4;
  7. background2.Y = 4;
  8.  

This only works if all the Scene background have the same name and are the first entity in the layer
« Last Edit: February 22, 2011, 01:40:29 PM by Prote1n »
Logged
 

Page created in 0.179 seconds with 23 queries.