summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/BitmapFont.xml31
-rw-r--r--doc/classes/DynamicFontData.xml5
-rw-r--r--platform/haiku/context_gl_haiku.cpp2
-rw-r--r--platform/haiku/context_gl_haiku.h2
-rw-r--r--platform/haiku/os_haiku.cpp4
-rw-r--r--platform/haiku/os_haiku.h2
-rw-r--r--platform/windows/context_gl_win.cpp2
-rw-r--r--platform/windows/context_gl_win.h2
-rw-r--r--platform/x11/context_gl_x11.cpp2
-rw-r--r--platform/x11/context_gl_x11.h2
-rw-r--r--platform/x11/os_x11.cpp4
-rw-r--r--platform/x11/os_x11.h2
12 files changed, 40 insertions, 20 deletions
diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml
index e983c59782..07027c4b42 100644
--- a/doc/classes/BitmapFont.xml
+++ b/doc/classes/BitmapFont.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BitmapFont" inherits="Font" category="Core" version="3.0.alpha.custom_build">
<brief_description>
+ Renders text using [code]*.fnt[/code] fonts.
</brief_description>
<description>
+ Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
</description>
<tutorials>
</tutorials>
@@ -23,7 +25,7 @@
<argument index="4" name="advance" type="float" default="-1">
</argument>
<description>
- Add a character to the font, where [i]character[/i] is the unicode value, [i]texture[/i] is the texture index, [i]rect[/i] is the region in the texture (in pixels!), [i]align[/i] is the (optional) alignment for the character and [i]advance[/i] is the (optional) advance.
+ Adds a character to the font, where [code]character[/code] is the unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
</description>
</method>
<method name="add_kerning_pair">
@@ -36,7 +38,7 @@
<argument index="2" name="kerning" type="int">
</argument>
<description>
- Add a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
+ Adds a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
</description>
</method>
<method name="add_texture">
@@ -45,14 +47,14 @@
<argument index="0" name="texture" type="Texture">
</argument>
<description>
- Add a texture to the [BitmapFont].
+ Adds a texture to the [BitmapFont].
</description>
</method>
<method name="clear">
<return type="void">
</return>
<description>
- Clear all the font data.
+ Clears all the font data and settings.
</description>
</method>
<method name="create_from_fnt">
@@ -61,6 +63,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
+ Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
</description>
</method>
<method name="get_char_size" qualifiers="const">
@@ -71,13 +74,14 @@
<argument index="1" name="next" type="int" default="0">
</argument>
<description>
- Return the size of a character, optionally taking kerning into account if the next character is provided.
+ Returns the size of a character, optionally taking kerning into account if the next character is provided.
</description>
</method>
<method name="get_fallback" qualifiers="const">
<return type="BitmapFont">
</return>
<description>
+ Returns the fallback BitmapFont.
</description>
</method>
<method name="get_kerning_pair" qualifiers="const">
@@ -88,7 +92,7 @@
<argument index="1" name="char_b" type="int">
</argument>
<description>
- Return a kerning pair as a difference.
+ Returns a kerning pair as a difference.
</description>
</method>
<method name="get_texture" qualifiers="const">
@@ -97,12 +101,14 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the font atlas texture at index [code]idx[/code].
</description>
</method>
<method name="get_texture_count" qualifiers="const">
<return type="int">
</return>
<description>
+ Returns the number of textures in the BitmapFont atlas.
</description>
</method>
<method name="set_ascent">
@@ -111,7 +117,7 @@
<argument index="0" name="px" type="float">
</argument>
<description>
- Set the font ascent (number of pixels above the baseline).
+ Sets the font ascent (number of pixels above the baseline).
</description>
</method>
<method name="set_distance_field_hint">
@@ -120,6 +126,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
+ If [code]true[/code] distance field hint is enabled.
</description>
</method>
<method name="set_fallback">
@@ -128,6 +135,7 @@
<argument index="0" name="fallback" type="BitmapFont">
</argument>
<description>
+ Sets the fallback BitmapFont.
</description>
</method>
<method name="set_height">
@@ -136,24 +144,31 @@
<argument index="0" name="px" type="float">
</argument>
<description>
- Set the total font height (ascent plus descent) in pixels.
+ Sets the total font height (ascent plus descent) in pixels.
</description>
</method>
</methods>
<members>
<member name="ascent" type="float" setter="set_ascent" getter="get_ascent">
+ Ascent (number of pixels above the baseline).
</member>
<member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars">
+ The characters in the BitmapFont.
</member>
<member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint">
+ If [code]true[/code] distance field hint is enabled.
</member>
<member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
+ The fallback font.
</member>
<member name="height" type="float" setter="set_height" getter="get_height">
+ Total font height (ascent plus descent) in pixels.
</member>
<member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings">
+ The font's kernings as [PoolIntArray].
</member>
<member name="textures" type="Array" setter="_set_textures" getter="_get_textures">
+ The font's [Texture]\ s.
</member>
</members>
<constants>
diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml
index 51e4e0d231..9012b46e08 100644
--- a/doc/classes/DynamicFontData.xml
+++ b/doc/classes/DynamicFontData.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DynamicFontData" inherits="Resource" category="Core" version="3.0.alpha.custom_build">
<brief_description>
+ Used with [DynamicFont] to describe the location of a font file.
</brief_description>
<description>
+ Used with [DynamicFont] to describe the location of a vector font file for dynamic rendering at runtime.
</description>
<tutorials>
</tutorials>
@@ -13,6 +15,7 @@
<return type="String">
</return>
<description>
+ Returns the font path.
</description>
</method>
<method name="set_font_path">
@@ -21,11 +24,13 @@
<argument index="0" name="path" type="String">
</argument>
<description>
+ Sets the font path.
</description>
</method>
</methods>
<members>
<member name="font_path" type="String" setter="set_font_path" getter="get_font_path">
+ The path to the vector font file.
</member>
</members>
<constants>
diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp
index 2b943df5ba..80d0bd78d5 100644
--- a/platform/haiku/context_gl_haiku.cpp
+++ b/platform/haiku/context_gl_haiku.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "context_gl_haiku.h"
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow *p_window) {
window = p_window;
diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h
index 40daf43ab9..a9a13a2b7f 100644
--- a/platform/haiku/context_gl_haiku.h
+++ b/platform/haiku/context_gl_haiku.h
@@ -30,7 +30,7 @@
#ifndef CONTEXT_GL_HAIKU_H
#define CONTEXT_GL_HAIKU_H
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
#include "drivers/gl_context/context_gl.h"
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index 9f2f88bb4e..1d52752f21 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -105,7 +105,7 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_
window->SetFlags(flags);
}
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
context_gl = memnew(ContextGL_Haiku(window));
context_gl->initialize();
context_gl->make_current();
@@ -161,7 +161,7 @@ void OS_Haiku::finalize() {
memdelete(input);
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
memdelete(context_gl);
#endif
}
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index d2fafb9129..d929f7e43b 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -60,7 +60,7 @@ private:
AudioDriverMediaKit driver_media_kit;
#endif
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
ContextGL_Haiku *context_gl;
#endif
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index 8640f27699..64b6d202a1 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED)
+#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED)
//
// C++ Implementation: context_gl_x11
diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h
index 912d4d0133..0059cbc311 100644
--- a/platform/windows/context_gl_win.h
+++ b/platform/windows/context_gl_win.h
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED)
+#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED)
//
// C++ Interface: context_gl_x11
//
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index 0cc9734119..4f9d4a84b9 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -30,7 +30,7 @@
#include "context_gl_x11.h"
#ifdef X11_ENABLED
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h
index ba01b51d59..c37bac5e9b 100644
--- a/platform/x11/context_gl_x11.h
+++ b/platform/x11/context_gl_x11.h
@@ -35,7 +35,7 @@
*/
#ifdef X11_ENABLED
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
#include "drivers/gl_context/context_gl.h"
#include "os/os.h"
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 041666a594..e389c6932e 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -235,7 +235,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
// maybe contextgl wants to be in charge of creating the window
//print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height));
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
context_gl = memnew(ContextGL_X11(x11_display, x11_window, current_videomode, true));
context_gl->initialize();
@@ -533,7 +533,7 @@ void OS_X11::finalize() {
XUnmapWindow(x11_display, x11_window);
XDestroyWindow(x11_display, x11_window);
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
memdelete(context_gl);
#endif
for (int i = 0; i < CURSOR_MAX; i++) {
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 0d5c272ed4..36355f11bc 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -94,7 +94,7 @@ class OS_X11 : public OS_Unix {
int xdnd_version;
-#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
+#if defined(OPENGL_ENABLED)
ContextGL_X11 *context_gl;
#endif
//Rasterizer *rasterizer;