1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
<title>PySFML - Python binding for SFML (Simple and Fast Multimedia Library) - String</title>
5
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
6
<link href="style.css" rel="stylesheet" type="text/css" />
10
<img src="http://www.sfml-dev.org/images/logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
12
<h1>sf.String Class Reference</h1>
13
<div class="class_desc">sf.String defines a graphical 2D text, that can be drawn on screen.<br />
14
Default constructor : String ()<br />
15
Construct the string from an unicode or an ascii string : String(Text, Font=sf.Font.GetDefaultFont(), Size=30.)<br />
16
Text : Text assigned to the string<br />
17
Font : Font used to draw the string (SFML built-in font by default)<br />
18
Size : Characters size (30 by default)</div>
19
<div class="base_class">Base class: <a href="Drawable.html">sf.Drawable</a>.</div>
21
<div class="attr_name">Bold</div>
22
<div class="attr_name">Italic</div>
23
<div class="attr_name">Regular</div>
24
<div class="attr_name">Underlined</div>
27
<div class="attr_name">GetCenter()</div>
28
<div class="desc">Get the center of the object, in coordinates relative to the object.<br /></div>
29
<div class="inherited">Inherited</div>
30
<div class="attr_name">GetCharacterPos(Index)</div>
31
<div class="desc">Return the visual position (a tuple of two floats) of the Index-th character of the string, in coordinates relative to the string (note : translation, center, rotation and scale are not applied)<br /> Index : Index of the character<br /></div>
32
<div class="attr_name">GetColor()</div>
33
<div class="desc">Get the color of the object.<br /></div>
34
<div class="inherited">Inherited</div>
35
<div class="attr_name">GetFont()</div>
36
<div class="desc">Get the font used by the string.<br /></div>
37
<div class="attr_name">GetPosition()</div>
38
<div class="desc">Get the position of the object.<br /></div>
39
<div class="inherited">Inherited</div>
40
<div class="attr_name">GetRect()</div>
41
<div class="desc">Get the string rectangle on screen.<br /></div>
42
<div class="attr_name">GetRotation()</div>
43
<div class="desc">Get the orientation of the object.<br /></div>
44
<div class="inherited">Inherited</div>
45
<div class="attr_name">GetScale()</div>
46
<div class="desc">Get the scale of the object.<br /></div>
47
<div class="inherited">Inherited</div>
48
<div class="attr_name">GetSize()</div>
49
<div class="desc">Get the size of the characters.<br /></div>
50
<div class="attr_name">GetStyle()</div>
51
<div class="desc">Get the style of the text.<br /></div>
52
<div class="attr_name">GetText()</div>
53
<div class="desc">Get the text as an unicode string.<br /></div>
54
<div class="attr_name">Move(OffsetX, OffsetY)</div>
55
<div class="desc">Move the object.<br /> OffsetX : X offset<br /> OffsetY : Y offset <br /></div>
56
<div class="inherited">Inherited</div>
57
<div class="attr_name">Rotate(Angle)</div>
58
<div class="desc">Rotate the object.<br /> Angle : Angle of rotation, in degrees<br /></div>
59
<div class="inherited">Inherited</div>
60
<div class="attr_name">Scale(FactorX, FactorY)</div>
61
<div class="desc">Scale the object.<br /> FactorX : Scaling factor on X (must be strictly positive)<br /> FactorY : Scaling factor on Y (must be strictly positive)<br /></div>
62
<div class="inherited">Inherited</div>
63
<div class="attr_name">SetBlendMode(Mode)</div>
64
<div class="desc">Set the blending mode for the object. The default blend mode is sf.Blend.Alpha<br /> Mode : New blending mode<br /></div>
65
<div class="inherited">Inherited</div>
66
<div class="attr_name">SetCenter(CenterX, CenterY)</div>
67
<div class="desc">Set the center of the object, in coordinates relative to the object.<br /> CenterX : X coordinate of the center<br /> CenterY : Y coordinate of the center<br /></div>
68
<div class="inherited">Inherited</div>
69
<div class="attr_name">SetColor(Color)</div>
70
<div class="desc">Set the color of the object.<br /> Color : New color<br /></div>
71
<div class="inherited">Inherited</div>
72
<div class="attr_name">SetFont(Font)</div>
73
<div class="desc">Set the font of the string.<br /> Font : font to use<br /></div>
74
<div class="attr_name">SetPosition(X, Y)</div>
75
<div class="desc">Set the position of the object.<br /> X : New X coordinate<br /> Y : New Y coordinate<br /></div>
76
<div class="inherited">Inherited</div>
77
<div class="attr_name">SetRotation(Rotation)</div>
78
<div class="desc">Set the orientation of the object.<br /> Rotation : Angle of rotation, in degrees<br /></div>
79
<div class="inherited">Inherited</div>
80
<div class="attr_name">SetScale(ScaleX, ScaleY)</div>
81
<div class="desc">Set the scale of the object.<br /> ScaleX : New horizontal scale (must be strictly positive)<br /> ScaleY : New vertical scale (must be strictly positive)<br /></div>
82
<div class="inherited">Inherited</div>
83
<div class="attr_name">SetScaleX(ScaleX)</div>
84
<div class="desc">Set the X scale factor of the object.<br /> ScaleX : New horizontal scale (must be strictly positive)<br /></div>
85
<div class="inherited">Inherited</div>
86
<div class="attr_name">SetScaleY(ScaleY)</div>
87
<div class="desc">Set the Y scale factor of the object.<br /> ScaleY : New vertical scale (must be strictly positive)<br /></div>
88
<div class="inherited">Inherited</div>
89
<div class="attr_name">SetSize(Size)</div>
90
<div class="desc">Set the size of the string.<br /> Size : New size, in pixels<br /></div>
91
<div class="attr_name">SetStyle(TextSize)</div>
92
<div class="desc">Set the style of the text. The default style is Regular.<br /> TextSize : New text style, (combination of Style values)<br /></div>
93
<div class="attr_name">SetText(UnicodeText) or SetText(Text, Encoding='utf8')</div>
94
<div class="desc">Set the text. Valid encodings are 'utf8', 'utf16' and 'utf32'.<br /> Text : New text<br /></div>
95
<div class="attr_name">SetX(X)</div>
96
<div class="desc">Set the X position of the object.<br /> X : New X coordinate<br /></div>
97
<div class="inherited">Inherited</div>
98
<div class="attr_name">SetY(Y)</div>
99
<div class="desc">Set the Y position of the object.<br /> Y : New Y coordinate<br /></div>
100
<div class="inherited">Inherited</div>
101
<div class="attr_name">TransformToGlobal(X, Y)</div>
102
<div class="desc">Transform a point from local coordinates into global coordinates (ie it applies the object's center, translation, rotation and scale to the point). Returns a tuple.<br /> X : X coordinate of the point to transform<br /> Y : Y coordinate of the point to transform<br /></div>
103
<div class="inherited">Inherited</div>
104
<div class="attr_name">TransformToLocal(X, Y)</div>
105
<div class="desc">Transform a point from global coordinates into local coordinates (ie it applies the inverse of object's center, translation, rotation and scale to the point). Returns a tuple.<br /> X : X coordinate of the point to transform<br /> Y : Y coordinate of the point to transform<br /></div>
106
<div class="inherited">Inherited</div>
112
:: Copyright © 2007-2008 Rémi Koenig ::