mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[godot] Fix compilation for 3.x, update to 3.5-stable
This commit is contained in:
parent
92ebbbfc48
commit
ffe4ad8538
4
.github/workflows/spine-godot.yml
vendored
4
.github/workflows/spine-godot.yml
vendored
@ -13,8 +13,8 @@ env:
|
|||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_EC2_METADATA_DISABLED: true
|
AWS_EC2_METADATA_DISABLED: true
|
||||||
EM_VERSION: 3.1.10
|
EM_VERSION: 3.1.10
|
||||||
GODOT_TAG: 3.4.4-stable
|
GODOT_TAG: 3.5-stable
|
||||||
GODOT_VERSION: 3.4.4.stable
|
GODOT_VERSION: 3.5.stable
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
@ -22,18 +22,18 @@ spine-godot supports all Spine features, except two-color tinting and the screen
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
spine-godot works with the latest stable Godot 3.4 release. It requires compilation of Godot, as spine-godot is implemented as a module.
|
spine-godot works with the latest stable Godot 3.5 release. It requires compilation of Godot, as spine-godot is implemented as a module.
|
||||||
|
|
||||||
> *NOTE:* spine-godot also compiles and works against Godot 4.x. However, we currently can not guarantee stability, as Godot 4.x is still heavily in flux.
|
> *NOTE:* spine-godot also compiles and works against Godot 4.x. However, we currently can not guarantee stability, as Godot 4.x is still heavily in flux.
|
||||||
|
|
||||||
### Pre-built Godot editor and export template binaries
|
### Pre-built Godot editor and export template binaries
|
||||||
|
|
||||||
We provide prebuilt Godot editor and export template binaries for Godot 3.4.4-stable:
|
We provide prebuilt Godot editor and export template binaries for Godot 3.5-stable:
|
||||||
|
|
||||||
* [Godot Editor Windows](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-windows.zip)
|
* [Godot Editor Windows](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.5-stable/godot-editor-windows.zip)
|
||||||
* [Godot Editor Linux](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-linux.zip)
|
* [Godot Editor Linux](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.5-stable/godot-editor-linux.zip)
|
||||||
* [Godot Editor macOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-macos.zip)
|
* [Godot Editor macOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.5-stable/godot-editor-macos.zip)
|
||||||
* [Godot export templates for Windows, Linux, macOS, Web, Android, iOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/spine-godot-templates-4.1-3.4.4-stable.tpz)
|
* [Godot export templates for Windows, Linux, macOS, Web, Android, iOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.5-stable/spine-godot-templates-4.1-3.5-stable.tpz)
|
||||||
|
|
||||||
### Building the Godot editor and export templates locally
|
### Building the Godot editor and export templates locally
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ To build the export template for a specific platform, run the following in a Bas
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd spine-godot
|
cd spine-godot
|
||||||
./build/setup.sh 3.4.4-stable false
|
./build/setup.sh 3.5-stable false
|
||||||
./build/build-templates.sh windows
|
./build/build-templates.sh windows
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ This repository contains a GitHub workflow in `.github/workflows/spine-godot.yml
|
|||||||
The resulting binaries will be attached as artifacts to a sucessful workflow run.
|
The resulting binaries will be attached as artifacts to a sucessful workflow run.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
Sample projects for both Godot 3.4.x and Godot 4.x are provided in the `example/` and `example-v4/` folders respectively. They illustrate all spine-godot functionality and can be opened and exported with the pre-built or custom build Godot editor and export template binaries.
|
Sample projects for both Godot 3.5.x and Godot 4.x are provided in the `example/` and `example-v4/` folders respectively. They illustrate all spine-godot functionality and can be opened and exported with the pre-built or custom build Godot editor and export template binaries.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -831,12 +831,21 @@ void SpineSprite::draw() {
|
|||||||
auto global_scale = get_global_scale();
|
auto global_scale = get_global_scale();
|
||||||
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
||||||
|
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
||||||
|
#else
|
||||||
|
float line_height = default_font->get_height() + default_font->get_descent();
|
||||||
|
#endif
|
||||||
float rect_width = 0;
|
float rect_width = 0;
|
||||||
for (int i = 0; i < hover_text_lines.size(); i++) {
|
for (int i = 0; i < hover_text_lines.size(); i++) {
|
||||||
rect_width = MAX(rect_width, default_font->get_string_size(hover_text_lines[i]).x);
|
rect_width = MAX(rect_width, default_font->get_string_size(hover_text_lines[i]).x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
Rect2 background_rect(0, -default_font->get_height(Font::DEFAULT_FONT_SIZE) - 5, rect_width + 20, line_height * hover_text_lines.size() + 10);
|
Rect2 background_rect(0, -default_font->get_height(Font::DEFAULT_FONT_SIZE) - 5, rect_width + 20, line_height * hover_text_lines.size() + 10);
|
||||||
|
#else
|
||||||
|
Rect2 background_rect(0, -default_font->get_height() - 5, rect_width + 20, line_height * hover_text_lines.size() + 10);
|
||||||
|
#endif
|
||||||
if (hover_text_lines.size() > 0) draw_rect(background_rect, Color(0, 0, 0, 0.8));
|
if (hover_text_lines.size() > 0) draw_rect(background_rect, Color(0, 0, 0, 0.8));
|
||||||
for (int i = 0; i < hover_text_lines.size(); i++) {
|
for (int i = 0; i < hover_text_lines.size(); i++) {
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user