-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconsole_bkgnd_flag_t.html
More file actions
96 lines (92 loc) · 5.42 KB
/
console_bkgnd_flag_t.html
File metadata and controls
96 lines (92 loc) · 5.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C2YXLNQ21C"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-C2YXLNQ21C');
</script>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>libtcod documentation | Background effect flags</title>
<script type="text/javascript" src="../js/doctcod.js"></script>
<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<link type="text/css" rel="stylesheet" href="../css/shCore.css">
</link>
<link type="text/css" rel="stylesheet" href="../css/shThemeDefault.css">
</link>
<script language="javascript" src="../js/shCore.js"></script>
<script language="javascript" src="../js/shBrushBash.js"></script>
<body>
<div class="header">
<p><span class="title1">libtcod</span><span class="title2">documentation</span></p>
</div>
<div class="breadcrumb">
<div class="breadcrumbtext">
<p>
you are here: <a onclick="link('../index2.html')">Index</a> > <a onclick="link('console.html')">2.
Console</a> > <a onclick="link('console_draw.html')">2.2. Drawing on the root console</a> > <a
onclick="link('console_bkgnd_flag_t.html')">2.2.2. Background effect flags</a><br>
<a class="prev" onclick="link('console_draw_basic.html')">2.2.1. Basic printing functions</a> | <a class="next"
onclick="link('console_print.html')">2.2.3. String drawing functions</a>
</p>
</div>
</div>
<div class="filter"><input type="checkbox" id="chk_c" name="chk_c" onchange="enable('c',this.checked)"
checked='checked'><label for='chk_c'> C </label><input type="checkbox" id="chk_cpp" name="chk_cpp"
onchange="enable('cpp',this.checked)" checked='checked'><label for='chk_cpp'> C++ </label><input type="checkbox"
id="chk_py" name="chk_py" onchange="enable('py',this.checked)" checked='checked'><label for='chk_py'> Py
</label><input type="checkbox" id="chk_lua" name="chk_lua" onchange="enable('lua',this.checked)"
disabled='disabled'><label class='disabled' for='chk_lua'> Lua </label><input type="checkbox" id="chk_cs"
name="chk_cs" onchange="enable('cs',this.checked)" disabled='disabled'><label class='disabled' for='chk_cs'> C#
</label></div>
<div class="main">
<div class="maintext">
<h1>2.2.2. Background effect flags</h1>
<p>This flag is used by most functions that modify a cell background color. It defines how the console's current
background color is used to modify the cell's existing background color :<br /> TCOD_BKGND_NONE : the cell's
background color is not modified.<br /> TCOD_BKGND_SET : the cell's background color is replaced by the
console's default background color : newbk = curbk.<br /> TCOD_BKGND_MULTIPLY : the cell's background color is
multiplied by the console's default background color : newbk = oldbk * curbk<br /> TCOD_BKGND_LIGHTEN : newbk =
MAX(oldbk,curbk)<br /> TCOD_BKGND_DARKEN : newbk = MIN(oldbk,curbk)<br /> TCOD_BKGND_SCREEN : newbk = white -
(white - oldbk) * (white - curbk) // inverse of multiply : (1-newbk) = (1-oldbk)*(1-curbk)<br />
TCOD_BKGND_COLOR_DODGE : newbk = curbk / (white - oldbk)<br /> TCOD_BKGND_COLOR_BURN : newbk = white - (white -
oldbk) / curbk<br /> TCOD_BKGND_ADD : newbk = oldbk + curbk<br /> TCOD_BKGND_ADDALPHA(alpha) : newbk = oldbk +
alpha*curbk<br /> TCOD_BKGND_BURN : newbk = oldbk + curbk - white<br /> TCOD_BKGND_OVERLAY : newbk = curbk.x
<= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk)<br /> TCOD_BKGND_ALPHA(alpha) : newbk =
(1.0f-alpha)*oldbk + alpha*(curbk-oldbk)<br /> TCOD_BKGND_DEFAULT : use the console's default background
flag<br /> Note that TCOD_BKGND_ALPHA and TCOD_BKGND_ADDALPHA are MACROS that needs a float parameter between
(0.0 and 1.0). TCOD_BKGND_ALPH and TCOD_BKGND_ADDA should not be used directly (else they will have the same
effect as TCOD_BKGND_NONE).<br /> For Python, remove TCOD_ : libtcod.BKGND_NONE<br /> For C# : None, Set,
Multiply, Lighten, Darken, Screen, ColodDodge, ColorBurn, Add, Burn Overlay, Default<br /> With lua, use
tcod.None, ..., tcod.Default, BUT tcod.console.Alpha(value) and tcod.console.AddAlpha(value)<br />
</p>
</div>
</div>
<div class="footer">
<div class="footertext">
<p>libtcod 1.6.4, © 2008, 2009, 2010, 2012, 2017 Jice, Mingos & rmtew<br>
This file has been generated by doctcod.</p>
<p>
<table width='100%'>
<tr>
<td width="33%"><a href="https://github.com/libtcod/libtcod">libtcod website</a></td>
<td width="33%"><a href="https://www.reddit.com/r/roguelikedev">libtcod on /r/roguelikedev</a></td>
<td width="33%">libtcod tutorials [ <a
href="http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod">Python</a> | <a
href="http://www.roguebasin.com/index.php?title=Complete_roguelike_tutorial_using_C%2B%2B_and_libtcod_-_part_1:_setting_up">C++</a> ]
</td>
</tr>
</table>
</p>
</div>
</div>
</body>
<script>
initFilter();
SyntaxHighlighter.all();
</script>
</html>