Author Topic: Picture transparency  (Read 834 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 110
Picture transparency
« on: November 25, 2015, 02:55:39 PM »
I would like to display my npc portraits with the actual dungeon in the background, but I could not find any hack to allow it. Have tried with sprites, but sadly they are limited in size. Has anyone found any workaround for picture transparency?

Insead of this

I would rather have this

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2131
    • Nol Drek's Web Site
Re: Picture transparency
« Reply #1 on: November 25, 2015, 03:10:52 PM »
I believe that you can use TLBUTIL to give transparency to any TLB file you are creating, even small pics that normally do not allow for transparency.

Try using this as your TLB.INF file if you don't want your small pics to have their own palette:
Code: [Select]
[palette]
first= 0
number_of_colors=1
4th_value=  8


[images]
  1 : height= 88 vertical=   0 horizontal=   0 width/4= 22 transparent=yes


Or use this if you as your TLB.INF file if you are using a standard small pic palette of 224 colors:
Code: [Select]
[palette]
first= 32
number_of_colors=224
4th_value=  8


[images]
  1 : height= 88 vertical=   0 horizontal=   0 width/4= 22 transparent=yes
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1932
Re: Picture transparency
« Reply #2 on: November 25, 2015, 03:19:48 PM »
Those pics look great.

Nothing like as sophisticated or elegant as Nol's answer, but what I have done is take a screen shot of the place where the event will occur, copy the relevant part from the viewport and put it in the background of the pic. Obviously this will only work for events where location and facing direction is known, but if you have sufficient art and event space you can make multiple versions of a pic and event to accomodate facing different directions.

Offline Adam

  • Full Member
  • ***
  • Posts: 110
Re: Picture transparency
« Reply #3 on: November 25, 2015, 04:11:49 PM »
I believe that you can use TLBUTIL to give transparency to any TLB file you are creating, even small pics that normally do not allow for transparency.
...

Thanks for that! Although it did not work (the transparent color was swapped with a gray background - I guess the default UI background color), I have learned a lot from these examples. If I understand it correctly, nothing but the text and UI background color is fixed on the palette. If I want to, I could rearrange the palette slots for my liking (background/wallset/combat icon/... palettes), I just have to stick with it and define those in the tlbs for all the images imported. That is really nice.

Offline hans

  • Hero Member
  • *****
  • Posts: 2667
Re: Picture transparency
« Reply #4 on: November 25, 2015, 06:57:16 PM »
I would like to display my npc portraits with the actual dungeon in the background, but I could not find any hack to allow it. Have tried with sprites, but sadly they are limited in size. Has anyone found any workaround for picture transparency?... 
 

Dan Autery's TOOLBOX program allows the creation of 88x88 *BIG* Sprites.   :)

Offline Adam

  • Full Member
  • ***
  • Posts: 110
Re: Picture transparency
« Reply #5 on: November 26, 2015, 11:48:20 AM »
Tanks, thats a near perfect solution. The minor problems are that sprites cannot be used for shop/temple/... events, and that most of the events cannot use the "nearby" and "far away" sprites, so it would be a waste of sprite slots to do all my npcs with sprites.

I'm thinking of using some kind of neutral background now, like the old gold boxes have done it.