Tint (DEF): Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''tint''' { [...] }
<span {{code}}>'''tint''' { [...] }</span>


Define a palette used to be used on tiles.
Define a palette used to be used on tiles.


Example:
== Tokens ==


tint { pal 1 red 127 green 127 blue 255 flags 0 }
<span {{code}}>'''pal''' <palnum></span>
 
The palette number the tint applies to.
 
<span {{code}}>'''red''' <value></span> (or '''r''')<br />
<span {{code}}>'''green''' <value></span> (or '''g''')<br />
<span {{code}}>'''blue''' <value></span> (or '''b''')
 
Specifies a color component value, in the range of 0 to 255.
 
<span {{code}}>'''shadered''' <value></span> (or '''sr''')<br />
<span {{code}}>'''shadegreen''' <value></span> (or '''sg''')<br />
<span {{code}}>'''shadeblue''' <value></span> (or '''sb''')
 
Specifies a color of the shade, in the range of 0 to 255.
 
<span {{code}}>'''flags''' <flags></span>


==Parameters==
Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values.


The brace-enclosed block may contain these instructions:
== Tint flags ==


{| {{prettytable}}
Note: By default, the <red>, <green> and <blue> parameters will use the "multiply" color mode. This mode decreases the colors proportionally. A value of 255 has no effect.
| '''pal''' <palnum>
| The palette number the tint applies to.
|-
| '''red''' <value>, '''r''' <value><br />'''green''' <value>, '''g''' <value><br />'''blue''' <value>, '''b''' <value>
| Specifies a color component value, in the range of 0 to 255.
|-
| '''flags''' <flags>
| Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values.
|-
|}


==Tint flags==
{{Template:Tint}}


Note: By default, the '''red''', '''green''' and '''blue''' parameters will use the "multiply" color mode. This mode decreases the colors proportionally. A value of 255 has no effect.
== Examples ==


{| {{prettytable}}
tint { pal 1 red 127 green 127 blue 255 flags 0 }
!Value!!Label!!Description!!
|-
| 1 || HICTINT_GRAYSCALE || Convert to grayscale.
|-
| 2 || HICTINT_INVERT || Invert colors.
|-
| 4 || HICTINT_COLORIZE || This enables the "colorize" color mode. This mode is similar to "multiply", except the end result will make the pixels 4x brighter. A value of 64 has no effect.
|-
| 8 || HICTINT_USEONART || Applies the tint instead of lookup palette on 8-bit tile.
|-
| 16 || HICTINT_APPLYOVERPALSWAP ||
|-
| 32 || HICTINT_APPLYOVERALTPAL ||
|-
| 64 || HICTINT_BLEND_SCREEN || This enables the "screen" color mode. This mode increases the colors proportionally. A value of zero has no effect.
|-
| 128 || HICTINT_BLEND_OVERLAY || Enables the "overlay" color mode. This mode increases or decreases the colors of the pixels from the middle. A value of 128 has no effect.
|-
| 64 + 128 || HICTINT_BLEND_HARDLIGHT || Same as overlay, but changes the priority between texture or color during the calculation.
|-
| 256 || HICTINT_ALWAYSUSEART || Force 8-bit texture to be displayed even if a hightile was defined.
|-
| 512 || HICTINT_NOFOGSHADE || Force an even visibility on the texture. Can be set for all palettes with GLOBAL_NO_GL_FOGSHADE on [[globalflags]].
|-
|}


[[Category:Def commands]]
[[Category:DEF commands]]

Latest revision as of 03:43, 23 February 2020

tint { [...] }

Define a palette used to be used on tiles.

Tokens

pal <palnum>

The palette number the tint applies to.

red <value> (or r)
green <value> (or g)
blue <value> (or b)

Specifies a color component value, in the range of 0 to 255.

shadered <value> (or sr)
shadegreen <value> (or sg)
shadeblue <value> (or sb)

Specifies a color of the shade, in the range of 0 to 255.

flags <flags>

Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values.

Tint flags

Note: By default, the <red>, <green> and <blue> parameters will use the "multiply" color mode. This mode decreases the colors proportionally. A value of 255 has no effect.


The following values are used by tint.

Value Label Description
1 HICTINT_GRAYSCALE Convert to grayscale.
2 HICTINT_INVERT Invert colors.
4 HICTINT_COLORIZE This enables the "colorize" color mode. This mode is similar to "multiply", except the end result will make the pixels 4x brighter. A value of 64 has no effect.
8 HICTINT_USEONART Applies the tint instead of lookup palette on 8-bit tile.
16 HICTINT_APPLYOVERPALSWAP
32 HICTINT_APPLYOVERALTPAL
64 HICTINT_BLEND_SCREEN This enables the "screen" color mode. This mode increases the colors proportionally. A value of zero has no effect.
128 HICTINT_BLEND_OVERLAY Enables the "overlay" color mode. This mode increases or decreases the colors of the pixels from the middle. A value of 128 has no effect.
64 + 128 HICTINT_BLEND_HARDLIGHT Same as overlay, but changes the priority between texture or color during the calculation.
256 HICTINT_ALWAYSUSEART Force 8-bit texture to be displayed even if a hightile was defined.
512 HICTINT_NOFOGSHADE Force an even visibility on the texture. Can be set for all palettes with GLOBAL_NO_GL_FOGSHADE on globalflags.

Examples

tint { pal 1 red 127 green 127 blue 255 flags 0 }