Skip to content

Commit

Permalink
Merge branch 'dev-lts'
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Mar 6, 2024
2 parents 57b127b + 2200bef commit 0f3c779
Show file tree
Hide file tree
Showing 124 changed files with 484 additions and 218 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center"><img src="https://raw.githubusercontent.com/JujuAdams/scribble/master/LOGO.png" style="display:block; margin:auto; width:300px"></p>
<h1 align="center">Scribble 8.7.0</h1>
<h1 align="center">Scribble 8.7.1</h1>

<p align="center">A modern text renderer for GameMaker LTS 2022</p>

Expand Down
10 changes: 6 additions & 4 deletions Scribble.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions objects/obj_example_glyph_position/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
typist = scribble_typist();
typist.in(0.1, 0);
28 changes: 28 additions & 0 deletions objects/obj_example_glyph_position/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
if (!SCRIBBLE_ALLOW_GLYPH_DATA_GETTER)
{
draw_text(10, 10, "SCRIBBLE_ALLOW_GLYPH_DATA_GETTER must be set to <true> for this test case");
return;
}

draw_clear(c_black);

var _x = 10;
var _y = 10;

var _text = "[scale,2]Hi world[/page]oijwagow\n\ngawoijgawj egonawegh";
var _element = scribble(_text);
if (keyboard_check_pressed(vk_up )) _element.page(_element.get_page()-1);
if (keyboard_check_pressed(vk_down)) _element.page(_element.get_page()+1);
_element.draw(_x, _y, typist);

if (typist.get_state() == 1)
{
var _last_glyph_data = _element.get_glyph_data(_element.get_glyph_count()-1);
if (is_struct(_last_glyph_data))
{
var _tri_x = _x + _last_glyph_data.right;
var _tri_y = _y + 0.5*(_last_glyph_data.top + _last_glyph_data.bottom);

draw_triangle(_tri_x, _tri_y, _tri_x+20, _tri_y-10, _tri_x+20, _tri_y+10, true);
}
}
34 changes: 34 additions & 0 deletions objects/obj_example_glyph_position/obj_example_glyph_position.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion objects/obj_test_devangari_basic/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ scribble_font_set_default("devanagari test");



index = 38;
index = 40;

testVectorArray = [
/* 0 */ { unicode: "गया", expected: "x;k" },
Expand Down Expand Up @@ -48,4 +48,5 @@ testVectorArray = [
/* 37 */ { unicode: "फॉक्स BS30", expected: "Q‚Dl BS30" },
/* 38 */ { unicode: "फ़िफ्टी", expected: "fQ¶Vh" },
/* 39 */ { unicode: "और", expected: "vkSj" },
/* 40 */ { unicode: "हम्म्...", expected: "gEe~---" },
];
5 changes: 5 additions & 0 deletions objects/obj_test_hebrew_kerning/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scribble_kerning_pair_set("fnt_hebrew", 0x05D1, 0x05BC, -2);
scribble_kerning_pair_set("fnt_hebrew", 0x05E4, 0x05BC, -6);
scribble_kerning_pair_set("fnt_hebrew", 0x05E9, 0x05C1, -7);
scribble_kerning_pair_set("fnt_hebrew", 0x05E9, 0x05C2, -7);
scribble_kerning_pair_set("fnt_hebrew", 0x05EA, 0x05BC, -8);
2 changes: 2 additions & 0 deletions objects/obj_test_hebrew_kerning/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var _element = scribble("בּ פּ שׁ שׂ תּ").scale(3).starting_format("fnt_hebrew", c_white);
_element.draw(x, y);
37 changes: 37 additions & 0 deletions objects/obj_test_hebrew_kerning/obj_test_hebrew_kerning.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion objects/obj_test_line_spacing/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@ var _x = 10;
var _y = 10;

var _element = scribble("Default\nbehaviour\ntest");
var _bbox = _element.get_bbox(_x, _y);
draw_rectangle(_bbox.left, _bbox.top, _bbox.right, _bbox.bottom, true);
_element.draw(_x, _y);

_y += _element.get_height() + 30;

var _element = scribble("Fixed size\nbehaviour\ntest");
_element.line_spacing(15);
var _bbox = _element.get_bbox(_x, _y);
draw_rectangle(_bbox.left, _bbox.top, _bbox.right, _bbox.bottom, true);
_element.draw(_x, _y);

_y += _element.get_height() + 30;

var _element = scribble("Double spacing\nbehaviour\ntest");
_element.line_spacing("200%");
var _bbox = _element.get_bbox(_x, _y);
draw_rectangle(_bbox.left, _bbox.top, _bbox.right, _bbox.bottom, true);
_element.draw(_x, _y);

_y += _element.get_height() + 30;
_y += _element.get_height() + 30;

var _element = scribble("Two lines in\nthis element");
_element.align(fa_center, fa_middle);
_element.line_spacing("50%");
var _bbox = _element.get_bbox(room_width/2, room_height/2);
draw_rectangle(_bbox.left, _bbox.top, _bbox.right, _bbox.bottom, true);
_element.draw(room_width/2, room_height/2);
draw_line(room_width/2 - 200, room_height/2, room_width/2 + 200, room_height/2);
6 changes: 3 additions & 3 deletions options/windows/options_windows.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions rooms/rm_example/rm_example.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rooms/rm_test/rm_test.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scripts/UnicodeToKrutidev/UnicodeToKrutidev.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
/// Unicode to Krutidev
/// @jujuadams 2022-01-29
///
Expand Down Expand Up @@ -465,4 +466,4 @@ function UnicodeToKrutidevDebug(_array)
}

return _outString;
}
}
12 changes: 9 additions & 3 deletions scripts/__scribble_class_element/__scribble_class_element.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
/// @param string
/// @param uniqueID

Expand Down Expand Up @@ -638,7 +639,9 @@ function __scribble_class_element(_string, _unique_id) constructor

static region_detect = function(_element_x, _element_y, _pointer_x, _pointer_y)
{
var _model = __get_model(true);
var _model = __get_model(true);
if (!is_struct(_model)) return undefined;

var _page = _model.__pages_array[__page];
var _region_array = _page.__region_array;

Expand Down Expand Up @@ -687,7 +690,9 @@ function __scribble_class_element(_string, _unique_id) constructor
return;
}

var _model = __get_model(true);
var _model = __get_model(true);
if (!is_struct(_model)) return undefined;

var _page = _model.__pages_array[__page];
var _region_array = _page.__region_array;

Expand Down Expand Up @@ -1826,6 +1831,7 @@ function __scribble_class_element(_string, _unique_id) constructor
__scale_to_box_dirty = false;

var _model = __get_model(true);
if (!is_struct(_model)) return undefined;

var _xscale = 1.0;
var _yscale = 1.0;
Expand Down Expand Up @@ -2057,4 +2063,4 @@ function __scribble_class_element(_string, _unique_id) constructor
}

#endregion
}
}
3 changes: 2 additions & 1 deletion scripts/__scribble_class_event/__scribble_class_event.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
function __scribble_class_event(_name, _data) constructor
{
//These are publicly exposed via .get_events()
Expand All @@ -6,4 +7,4 @@ function __scribble_class_event(_name, _data) constructor
position = undefined; //Legacy
character_index = undefined;
line_index = undefined;
}
}
3 changes: 2 additions & 1 deletion scripts/__scribble_class_font/__scribble_class_font.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
/// @param fontName
/// @param glyphCount
/// @param isMSDF
Expand Down Expand Up @@ -87,4 +88,4 @@ function __scribble_class_font(_name, _glyph_count, _msdf) constructor
__source_sprite = undefined;
}
}
}
}
1 change: 1 addition & 0 deletions scripts/__scribble_class_model/__scribble_class_model.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
/// @param element
/// @param modelCacheName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Feather disable all
function __scribble_class_null_element() constructor
{
static __error = function()
Expand Down
Loading

0 comments on commit 0f3c779

Please sign in to comment.