diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml
index e3cddad83..2a781ed32 100644
--- a/.github/workflows/format-check.yml
+++ b/.github/workflows/format-check.yml
@@ -1,48 +1,28 @@
-name: Check format
+name: Check Formatting
on:
push:
workflow_dispatch:
jobs:
- build:
- runs-on: ubuntu-latest
+ check:
+ runs-on: ubuntu-24.04
steps:
- - name: Install OS dependencies (needed for act on ubuntu-latest)
- run: |
- sudo apt update
- sudo apt install -y --force-yes curl xz-utils libicu-dev git dos2unix
- wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
- sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
-
- uses: actions/checkout@v3
- - name: Cache Clang
- id: cache-clang
- uses: actions/cache@v3
- with:
- path: clang
- key: ${{ runner.os }}-clang-13-0-1
-
- - name: Install Clang
- if: steps.cache-clang.outputs.cache-hit != 'true'
- run: |
- curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz --output clang.tar.xz
- tar -xf clang.tar.xz
- mv clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04 clang
+ - name: Setup clang-format
+ run: ./formatters/setup-clang-format-docker.sh
- name: Install dotnet
uses: actions/setup-dotnet@v3
with:
- dotnet-version: "6.0.x"
- - run: dotnet tool install -g dotnet-format
+ dotnet-version: "8.0.x"
- - name: Install Node and dependenceis
+ - name: Install Node and dependencies
uses: actions/setup-node@v3
with:
- node-version: "16"
- - run: npm install -g typescript typescript-formatter
+ node-version: "24"
- name: Install JDK
uses: actions/setup-java@v3
@@ -50,14 +30,29 @@ jobs:
distribution: 'zulu'
java-version: "16"
+ - name: Install Haxe
+ uses: krdlab/setup-haxe@v1
+ with:
+ haxe-version: '4.3.2'
+ - run: haxelib install formatter
+
+ - name: Install Dart
+ uses: dart-lang/setup-dart@v1
+ with:
+ sdk: '3.8.1'
+
+ - name: Check dart format version
+ run: |
+ dart format --version
+
- name: Format
run: |
- export CLANGFORMAT=`pwd`/clang/bin/clang-format
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet-format --version
- ./formatters/format.sh
- find . -type f -name '*.cs' -exec perl -pi -e 's/\r\n/\n/g' '{}' +
- git diff
+ ./formatters/format-cpp.sh
+ ./formatters/format-csharp.sh
+ ./formatters/format-dart.sh
+ ./formatters/format-haxe.sh
+ ./formatters/format-java.sh
+ ./formatters/format-ts.sh
git diff > format-diff.txt
- name: Archive formatting result
diff --git a/.gitignore b/.gitignore
index e7ca0f590..01d836a35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -252,3 +252,5 @@ spine-libgdx/.project
.clang-format
spine-c/codegen/spine-cpp-types.json
spine-flutter/example/devtools_options.yaml
+spine-glfw/.cache
+formatters/eclipse-formatter/format-diff.txt
diff --git a/formatters/.clang-format b/formatters/.clang-format
index 4edd46c68..469dba70c 100644
--- a/formatters/.clang-format
+++ b/formatters/.clang-format
@@ -70,6 +70,7 @@ SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
+SpaceInEmptyBlock: true
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
diff --git a/formatters/.editorconfig b/formatters/.editorconfig
index 65b41a160..22fdec84d 100644
--- a/formatters/.editorconfig
+++ b/formatters/.editorconfig
@@ -12,7 +12,7 @@ indent_style = tab
tab_width = 4
# New line preferences
-end_of_line = crlf
+end_of_line = lf
insert_final_newline = true
#### .NET Coding Conventions ####
diff --git a/formatters/.gitignore b/formatters/.gitignore
new file mode 100644
index 000000000..23d818327
--- /dev/null
+++ b/formatters/.gitignore
@@ -0,0 +1 @@
+eclipse-formatter/target/
diff --git a/formatters/README.md b/formatters/README.md
index d896d422f..a72d4ea7d 100644
--- a/formatters/README.md
+++ b/formatters/README.md
@@ -1,11 +1,103 @@
-# Formatters
-This folder contains formatter configuration files to be used with IDEs as well as the [spotless](https://github.com/diffplug/spotless/blob/main/plugin-gradle/README.md) formatter expressed in the Gradle project in this directory.
+# Spine Runtimes Code Formatters
-You will need the following on your `PATH`:
+This directory contains formatting scripts and tools to ensure consistent code style across all Spine runtime implementations.
-- JDK 10+
-- clang-format 12.0.1 (i.e. `brew install clang-format`). Also set the environment variable `CLANGFORMAT` to the path of the `clang-format` executable.
-- dotnet format (i.e. `dotnet tool install -g dotnet-format`, comes with dotnet 6 out of the box)
-- tsfmt, (i.e. `npm install -g typescript-formatter`)
+## Scripts
-To run the formatter, invoke the `format.sh` script. This will shuffle around the Gradle config files, invoke spotless, then undo the config file shuffling. Invoking `./gradlew spotlessApply` from the `formatters/` directory will not work.
\ No newline at end of file
+### format-cpp.sh
+Formats C/C++ source files using clang-format.
+- **Prerequisites**: clang-format 18.1.8
+- **Coverage**: All C/C++ files in spine-cpp, spine-c, spine-godot, spine-ue, spine-glfw, spine-sdl, spine-sfml, spine-cocos2dx, spine-ios, spine-flutter
+- **Configuration**: Uses .clang-format configuration file
+- **Behavior**: Batches all files in a single clang-format call for performance
+
+### format-csharp.sh
+Formats C# source files using dotnet format.
+- **Prerequisites**: .NET SDK with dotnet format tool
+- **Coverage**: All C# files in spine-csharp, spine-monogame, spine-unity
+- **Configuration**: Uses .editorconfig (temporarily copied to each project)
+- **Behavior**: Runs with --no-restore and --verbosity quiet to suppress warnings
+
+### format-dart.sh
+Formats Dart source files using dart format.
+- **Prerequisites**: Dart SDK
+- **Coverage**: All Dart files in spine-flutter
+- **Configuration**: Uses --page-width 120 parameter
+- **Behavior**: Formats all files in place
+
+### format-haxe.sh
+Formats Haxe source files using haxelib formatter.
+- **Prerequisites**: Haxe and haxelib formatter package
+- **Coverage**: All Haxe files in spine-haxe
+- **Configuration**: Uses hxformat.json configuration file
+- **Behavior**: Formats all files in place
+
+### format-java.sh
+Formats Java source files using a custom Eclipse formatter.
+- **Prerequisites**: Java JDK and Maven
+- **Coverage**: All Java files in spine-libgdx and spine-android
+- **Configuration**: Uses eclipse-formatter.xml configuration file
+- **Behavior**: Builds Eclipse formatter JAR if needed, only outputs changed files
+
+### format-ts.sh
+Formats TypeScript source files using typescript-formatter.
+- **Prerequisites**: Node.js and npm
+- **Coverage**: All TypeScript files in spine-ts and tests
+- **Configuration**: Uses tsfmt.json configuration files
+- **Behavior**: Uses npx to auto-download formatter, validates tsfmt.json consistency
+
+### setup-clang-format-docker.sh
+Helper script for GitHub Actions to set up clang-format via Docker.
+- **Prerequisites**: Docker
+- **Purpose**: Creates a wrapper script that runs clang-format 18.1.8 in a Docker container
+- **Usage**: Called by GitHub Actions workflow to ensure version consistency
+
+## Configuration Files
+
+- **.clang-format**: C/C++ formatting rules
+- **.editorconfig**: C# formatting rules
+- **eclipse-formatter.xml**: Java formatting rules for Eclipse formatter
+- **hxformat.json**: Haxe formatting rules
+
+## Eclipse Formatter
+
+The eclipse-formatter directory contains a Maven project that builds a standalone Eclipse code formatter:
+- **Source**: eclipse-formatter/src/main/java/com/esotericsoftware/spine/formatter/EclipseFormatter.java
+- **Build**: Automatically built by format-java.sh when the JAR doesn't exist or source is newer
+- **Output**: Only prints files that were actually modified
+
+## GitHub Actions Workflow
+
+The formatting check runs automatically on push and can be triggered manually:
+
+1. **Workflow file**: .github/workflows/format-check-new.yml
+2. **Process**:
+ - Sets up all required formatters and dependencies
+ - Runs all format scripts
+ - Captures any file changes to format-diff.txt
+ - Uploads diff as artifact
+ - Fails if any files were modified
+
+### Docker-based clang-format
+
+To ensure consistent formatting across local development and CI, the workflow uses Docker to run clang-format 18.1.8. The setup-clang-format-docker.sh script creates a wrapper that:
+- Mounts the project directory in the Docker container
+- Converts relative paths to absolute paths
+- Runs clang-format with the same version everywhere
+
+## Local Development
+
+To run formatters locally:
+
+```bash
+cd formatters
+./format-cpp.sh # Format C/C++ files
+./format-csharp.sh # Format C# files
+./format-dart.sh # Format Dart files
+./format-haxe.sh # Format Haxe files
+./format-java.sh # Format Java files
+./format-ts.sh # Format TypeScript files
+./format.sh # Format everything
+```
+
+Ensure you have the required tools installed for each formatter you want to run.
\ No newline at end of file
diff --git a/formatters/build.gradle b/formatters/build.gradle
deleted file mode 100644
index 1b8b485ae..000000000
--- a/formatters/build.gradle
+++ /dev/null
@@ -1,51 +0,0 @@
-buildscript { repositories { mavenCentral() }}
-
-plugins {
- id "com.diffplug.spotless" version "5.14.0"
-}
-
-spotless {
- lineEndings 'UNIX'
-
- java {
- target 'spine-libgdx/**/*.java',
- 'spine-android/**/*.java'
- eclipse().configFile('formatters/eclipse-formatter.xml')
- }
-
- cpp {
- target 'spine-c/**/*.c',
- 'spine-c/**/.h',
- 'spine-cpp/**/*.cpp',
- 'spine-cpp/**/.h',
- 'spine-cocos2dx/src/**/*.cpp',
- 'spine-cocos2dx/src/**/*.h',
- 'spine-cocos2dx/example/Classes/**/*.cpp',
- 'spine-cocos2dx/example/Classes/**/*.h',
- 'spine-glfw/src/**/*.cpp',
- 'spine-glfw/src/**/*.h',
- 'spine-glfw/example/**/*.cpp',
- 'spine-glfw/example/**/*.h',
- 'spine-sdl/src/**/*.c',
- 'spine-sdl/src/**/*.cpp',
- 'spine-sdl/src/**/*.h',
- 'spine-sdl/example/**/*.c',
- 'spine-sdl/example/**/*.cpp',
- 'spine-sdl/example/**/*.h',
- 'spine-sfml/c/src/**/*.c',
- 'spine-sfml/c/src/**/*.h',
- 'spine-sfml/cpp/src/**/*.cpp',
- 'spine-sfml/cpp/src/**/*.h',
- 'spine-ue/**/*.cpp',
- 'spine-ue/**/*.h',
- 'spine-godot/spine_godot/*.cpp',
- 'spine-godot/spine_godot/*.h'
- clangFormat("13.0.1").pathToExe("$System.env.CLANGFORMAT").style('file')
- }
-
- typescript {
- target 'spine-ts/**/src/*.ts'
- targetExclude 'spine-ts/**/*.d.ts', 'spine-ts/**/node_modules/**/*.ts'
- tsfmt('7.2.2').tsfmtFile('formatters/tsfmt.json')
- }
-}
\ No newline at end of file
diff --git a/formatters/eclipse-formatter/pom.xml b/formatters/eclipse-formatter/pom.xml
new file mode 100644
index 000000000..2fb1a086f
--- /dev/null
+++ b/formatters/eclipse-formatter/pom.xml
@@ -0,0 +1,106 @@
+
+
+ 4.0.0
+
+ com.esotericsoftware.spine
+ eclipse-formatter
+ 1.0.0
+ jar
+
+
+ 11
+ 11
+ UTF-8
+ 4.26
+
+
+
+
+
+ org.eclipse.jdt
+ org.eclipse.jdt.core
+ 3.32.0
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.text
+ 3.12.300
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.jface.text
+ 3.22.0
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.core.runtime
+ 3.26.100
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.equinox.common
+ 3.17.100
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.core.resources
+ 3.18.100
+
+
+
+
+ org.eclipse.platform
+ org.eclipse.osgi
+ 3.18.300
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.11.0
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.6.0
+
+
+ jar-with-dependencies
+
+
+
+ com.esotericsoftware.spine.formatter.EclipseFormatter
+
+
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/formatters/eclipse-formatter/src/main/java/com/esotericsoftware/spine/formatter/EclipseFormatter.java b/formatters/eclipse-formatter/src/main/java/com/esotericsoftware/spine/formatter/EclipseFormatter.java
new file mode 100644
index 000000000..b8ad48d1a
--- /dev/null
+++ b/formatters/eclipse-formatter/src/main/java/com/esotericsoftware/spine/formatter/EclipseFormatter.java
@@ -0,0 +1,129 @@
+package com.esotericsoftware.spine.formatter;
+
+import java.io.*;
+import java.nio.file.*;
+import java.util.*;
+import javax.xml.parsers.*;
+import org.w3c.dom.*;
+import org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.text.edits.TextEdit;
+
+public class EclipseFormatter {
+ private static final String LINE_DELIMITER = "\n";
+
+ public static void main(String[] args) throws Exception {
+ if (args.length < 2) {
+ System.err.println("Usage: java -jar eclipse-formatter.jar [file2.java ...]");
+ System.exit(1);
+ }
+
+ // Load formatter settings from XML
+ Map options = loadFormatterSettings(args[0]);
+
+ // Create formatter
+ CodeFormatter formatter = new DefaultCodeFormatter(options);
+
+ // Format each file
+ int changedCount = 0;
+ int errorCount = 0;
+
+ for (int i = 1; i < args.length; i++) {
+ try {
+ if (formatFile(formatter, args[i])) {
+ changedCount++;
+ }
+ } catch (Exception e) {
+ System.err.println("Error formatting " + args[i] + ": " + e.getMessage());
+ errorCount++;
+ }
+ }
+
+ System.out.println("Formatting complete: " + changedCount + " files changed, " + errorCount + " errors");
+
+ if (errorCount > 0) {
+ System.exit(1);
+ }
+ }
+
+ private static Map loadFormatterSettings(String xmlPath) throws Exception {
+ Map settings = new HashMap<>();
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ org.w3c.dom.Document doc = builder.parse(new File(xmlPath));
+
+ // Handle both direct settings and profile-based settings
+ NodeList profiles = doc.getElementsByTagName("profile");
+ if (profiles.getLength() > 0) {
+ // Profile-based format (Eclipse export)
+ Element profile = (Element) profiles.item(0);
+ NodeList settingNodes = profile.getElementsByTagName("setting");
+
+ for (int i = 0; i < settingNodes.getLength(); i++) {
+ Element setting = (Element) settingNodes.item(i);
+ String id = setting.getAttribute("id");
+ String value = setting.getAttribute("value");
+ if (id != null && !id.isEmpty() && value != null) {
+ settings.put(id, value);
+ }
+ }
+ } else {
+ // Direct settings format
+ NodeList settingNodes = doc.getElementsByTagName("setting");
+
+ for (int i = 0; i < settingNodes.getLength(); i++) {
+ Element setting = (Element) settingNodes.item(i);
+ String id = setting.getAttribute("id");
+ String value = setting.getAttribute("value");
+ if (id != null && !id.isEmpty() && value != null) {
+ settings.put(id, value);
+ }
+ }
+ }
+
+ // Removed verbose output
+
+ return settings;
+ }
+
+ private static boolean formatFile(CodeFormatter formatter, String filePath) throws Exception {
+ Path path = Paths.get(filePath);
+
+ if (!Files.exists(path)) {
+ throw new FileNotFoundException("File not found: " + filePath);
+ }
+
+ String content = Files.readString(path);
+
+ // Determine if it's a module-info.java file
+ int kind = path.getFileName().toString().equals("module-info.java")
+ ? CodeFormatter.K_MODULE_INFO
+ : CodeFormatter.K_COMPILATION_UNIT;
+ kind |= CodeFormatter.F_INCLUDE_COMMENTS;
+
+ // Format the code
+ TextEdit edit = formatter.format(kind, content, 0, content.length(), 0, LINE_DELIMITER);
+
+ if (edit == null) {
+ throw new IllegalArgumentException("Cannot format file - invalid Java syntax or formatter configuration issue");
+ }
+
+ // Apply the edit
+ IDocument document = new Document(content);
+ edit.apply(document);
+ String formatted = document.get();
+
+ // Only write if content changed
+ if (!content.equals(formatted)) {
+ Files.writeString(path, formatted);
+ System.out.println("Formatted: " + filePath);
+ return true;
+ } else {
+ // Silent when no changes
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/formatters/format-cpp.sh b/formatters/format-cpp.sh
index 23e8b3d91..b56aa7916 100755
--- a/formatters/format-cpp.sh
+++ b/formatters/format-cpp.sh
@@ -6,8 +6,12 @@ echo "Formatting C/C++ files..."
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-if [ ! -f "$dir/.clang-format" ]; then
+# Store original directory
+pushd "$dir" > /dev/null
+
+if [ ! -f ".clang-format" ]; then
echo "Error: .clang-format not found in formatters directory"
+ popd > /dev/null
exit 1
fi
@@ -84,28 +88,20 @@ done
echo "Found ${#files[@]} C/C++ files to format"
-# Format each file with progress
-count=0
-errors=0
-for file in "${files[@]}"; do
- count=$((count + 1))
- # Show progress every 10 files or for the last file
- if [ $((count % 10)) -eq 0 ] || [ $count -eq ${#files[@]} ]; then
- printf "\r[$count/${#files[@]}] Formatting: %-80s" "$(basename "$file")"
- fi
-
- # Format the file and capture any errors
- if ! clang-format -i -style=file:"$dir/.clang-format" "$file" 2>/dev/null; then
- printf "\nError formatting: $file\n"
- errors=$((errors + 1))
- fi
-done
-
-# Clear the progress line and show completion
-printf "\r%-100s\r" " "
+# Format all files in one call - works for both Docker and native
+echo "Formatting ${#files[@]} files..."
+if ! clang-format -i -style=file:".clang-format" "${files[@]}" 2>&1; then
+ echo "Error: clang-format failed"
+ errors=1
+else
+ errors=0
+fi
if [ $errors -gt 0 ]; then
echo "Completed with $errors errors"
fi
-echo "C/C++ formatting complete"
\ No newline at end of file
+echo "C/C++ formatting complete"
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format-csharp.sh b/formatters/format-csharp.sh
index 9cd06c508..05051686a 100755
--- a/formatters/format-csharp.sh
+++ b/formatters/format-csharp.sh
@@ -6,20 +6,43 @@ echo "Formatting C# files..."
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-if command -v dotnet-format &> /dev/null; then
+if command -v dotnet &> /dev/null; then
+ # Store original directory
+ pushd "$dir" > /dev/null
+
# Copy .editorconfig to C# directories
cp .editorconfig ../spine-csharp/ 2>/dev/null || true
cp .editorconfig ../spine-monogame/ 2>/dev/null || true
cp .editorconfig ../spine-unity/ 2>/dev/null || true
- dotnet-format ../spine-csharp/spine-csharp.sln || true
- dotnet-format -f ../spine-monogame || true
- dotnet-format -f ../spine-unity || true
+ # Format spine-csharp
+ pushd ../spine-csharp > /dev/null
+ dotnet format spine-csharp.csproj --no-restore --verbosity quiet 2>/dev/null || echo "Warning: Some issues with spine-csharp formatting"
+ popd > /dev/null
+
+ # Format spine-monogame
+ pushd ../spine-monogame > /dev/null
+ dotnet format --no-restore --verbosity quiet 2>/dev/null || echo "Warning: Some issues with spine-monogame formatting"
+ popd > /dev/null
+
+ # Format spine-unity - look for .cs files directly
+ if [ -d ../spine-unity ]; then
+ echo "Formatting spine-unity C# files directly..."
+ pushd ../spine-unity > /dev/null
+ # Find all .cs files and format them using dotnet format whitespace
+ find . -name "*.cs" -type f -not -path "./Library/*" -not -path "./Temp/*" -not -path "./obj/*" -not -path "./bin/*" | while read -r file; do
+ dotnet format whitespace --include "$file" --no-restore 2>/dev/null || true
+ done
+ popd > /dev/null
+ fi
# Clean up .editorconfig files
rm -f ../spine-csharp/.editorconfig
rm -f ../spine-monogame/.editorconfig
rm -f ../spine-unity/.editorconfig
+
+ # Return to original directory
+ popd > /dev/null
else
- echo "Warning: dotnet-format not found. Skipping C# formatting."
+ echo "Warning: dotnet not found. Skipping C# formatting."
fi
\ No newline at end of file
diff --git a/formatters/format-dart.sh b/formatters/format-dart.sh
index 601cd2bc8..558c6a95d 100755
--- a/formatters/format-dart.sh
+++ b/formatters/format-dart.sh
@@ -4,12 +4,20 @@ set -e
# Format Dart files
echo "Formatting Dart files..."
+dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Store original directory
+pushd "$dir" > /dev/null
+
if command -v dart &> /dev/null; then
find .. -name "*.dart" \
-not -path "*/.*" \
-not -path "*/node_modules/*" \
-not -path "*/build/*" \
- -exec dart format {} +
+ -exec dart format --page-width 120 {} +
else
echo "Warning: dart not found. Skipping Dart formatting."
-fi
\ No newline at end of file
+fi
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format-haxe.sh b/formatters/format-haxe.sh
index d034523d9..4c02cb069 100755
--- a/formatters/format-haxe.sh
+++ b/formatters/format-haxe.sh
@@ -4,12 +4,19 @@ set -e
# Format Haxe files
echo "Formatting Haxe files..."
+dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Store original directory
+pushd "$dir" > /dev/null
+
if command -v haxelib &> /dev/null && haxelib list formatter &> /dev/null; then
- find .. -name "*.hx" \
- -not -path "*/.*" \
- -not -path "*/node_modules/*" \
- -not -path "*/build/*" \
- | xargs haxelib run formatter -s
+ # Format spine-haxe directory
+ if [ -d ../spine-haxe ]; then
+ haxelib run formatter -s ../spine-haxe
+ fi
else
echo "Warning: haxe formatter not found. Install with: haxelib install formatter"
-fi
\ No newline at end of file
+fi
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format-java.sh b/formatters/format-java.sh
index 93c837bc1..fa7934c19 100755
--- a/formatters/format-java.sh
+++ b/formatters/format-java.sh
@@ -1,9 +1,42 @@
#!/bin/bash
set -e
-# Format Java files with Spotless (keeping this for Eclipse formatter)
+# Format Java files with Eclipse formatter
echo "Formatting Java files..."
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-./formatters/gradlew -p formatters spotlessJavaApply --quiet
\ No newline at end of file
+# Store original directory
+pushd "$dir" > /dev/null
+
+# Build the Eclipse formatter if needed
+jar_file="eclipse-formatter/target/eclipse-formatter-1.0.0-jar-with-dependencies.jar"
+src_file="eclipse-formatter/src/main/java/com/esotericsoftware/spine/formatter/EclipseFormatter.java"
+
+if [ ! -f "$jar_file" ] || [ "$src_file" -nt "$jar_file" ]; then
+ echo "Building Eclipse formatter..."
+ pushd eclipse-formatter > /dev/null
+ mvn -q clean package
+ popd > /dev/null
+fi
+
+# Find all Java files
+java_files=$(find ../spine-libgdx ../spine-android -name "*.java" -type f \
+ -not -path "*/build/*" \
+ -not -path "*/.gradle/*" \
+ -not -path "*/bin/*" \
+ -not -path "*/gen/*" \
+ -not -path "*/target/*")
+
+# Run the formatter
+if [ -n "$java_files" ]; then
+ echo "Running Eclipse formatter on Java files..."
+ java -jar eclipse-formatter/target/eclipse-formatter-1.0.0-jar-with-dependencies.jar \
+ eclipse-formatter.xml \
+ $java_files
+fi
+
+echo "Java formatting complete"
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format-swift.sh b/formatters/format-swift.sh
index d39767952..819931c55 100755
--- a/formatters/format-swift.sh
+++ b/formatters/format-swift.sh
@@ -4,6 +4,11 @@ set -e
# Format Swift files
echo "Formatting Swift files..."
+dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Store original directory
+pushd "$dir" > /dev/null
+
if command -v swift-format &> /dev/null; then
find .. -name "*.swift" \
-not -path "*/.*" \
@@ -12,4 +17,7 @@ if command -v swift-format &> /dev/null; then
| xargs swift-format -i
else
echo "Warning: swift-format not found. Install from https://github.com/apple/swift-format"
-fi
\ No newline at end of file
+fi
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format-ts.sh b/formatters/format-ts.sh
index 741209a70..2ea327518 100755
--- a/formatters/format-ts.sh
+++ b/formatters/format-ts.sh
@@ -6,13 +6,25 @@ echo "Formatting TypeScript files..."
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+# Store original directory
+pushd "$dir" > /dev/null
+
# Check if tsfmt.json files match
if ! cmp -s ../spine-ts/tsfmt.json ../tests/tsfmt.json; then
echo -e "\033[1;31mERROR: spine-ts/tsfmt.json and tests/tsfmt.json differ!\033[0m"
echo -e "\033[1;31mPlease sync them to ensure consistent formatting.\033[0m"
+ popd > /dev/null
exit 1
fi
# Format TypeScript files
-cd ../spine-ts && npm run format && cd ../formatters
-cd ../tests && npm run format -r && cd ../formatters
\ No newline at end of file
+pushd ../spine-ts > /dev/null
+npm run format
+popd > /dev/null
+
+pushd ../tests > /dev/null
+npm run format
+popd > /dev/null
+
+# Return to original directory
+popd > /dev/null
\ No newline at end of file
diff --git a/formatters/format.sh b/formatters/format.sh
index f22b003c3..f2bc76e56 100755
--- a/formatters/format.sh
+++ b/formatters/format.sh
@@ -31,10 +31,10 @@ show_help() {
echo "Multiple language flags can be combined, e.g.: ./format.sh java ts"
echo ""
echo "Tools used:"
- echo " Java: Spotless with Eclipse formatter"
- echo " TypeScript: Biome"
+ echo " Java: Eclipse formatter (via eclipse-formatter.xml)"
+ echo " TypeScript: tsfmt (typescript-formatter)"
echo " C/C++: clang-format"
- echo " C#: dotnet-format"
+ echo " C#: dotnet format"
echo " Haxe: haxe formatter"
echo " Dart: dart format"
echo " Swift: swift-format"
diff --git a/formatters/gradle/wrapper/gradle-wrapper.jar b/formatters/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 01b8bf6b1..000000000
Binary files a/formatters/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/formatters/gradle/wrapper/gradle-wrapper.properties b/formatters/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 6b74f0f6b..000000000
--- a/formatters/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
diff --git a/formatters/gradlew b/formatters/gradlew
deleted file mode 100755
index cccdd3d51..000000000
--- a/formatters/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env sh
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"
diff --git a/formatters/gradlew.bat b/formatters/gradlew.bat
deleted file mode 100644
index f9553162f..000000000
--- a/formatters/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/formatters/settings.gradle b/formatters/settings.gradle
deleted file mode 100644
index c98ec4958..000000000
--- a/formatters/settings.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-include ':spine-libgdx:spine-libgdx'
-include ':spine-libgdx:spine-libgdx-tests'
-include ':spine-libgdx:spine-skeletonviewer'
diff --git a/formatters/setup-clang-format-docker.sh b/formatters/setup-clang-format-docker.sh
new file mode 100755
index 000000000..f045aec92
--- /dev/null
+++ b/formatters/setup-clang-format-docker.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+set -e
+
+echo "Setting up clang-format Docker wrapper..."
+
+# Pull the Docker image with clang-format 18
+echo "Pulling Docker image..."
+docker pull silkeh/clang:18
+
+# Create a wrapper script that runs clang-format in Docker
+echo "Creating wrapper script..."
+cat > /tmp/clang-format-wrapper <<'EOF'
+#!/bin/bash
+# Get the absolute path of the file being formatted
+args=()
+for arg in "$@"; do
+ if [[ -f "$arg" ]]; then
+ # Convert to absolute path
+ args+=("$(realpath "$arg")")
+ else
+ args+=("$arg")
+ fi
+done
+
+# Find the project root (where .github directory is)
+current_dir="$PWD"
+while [[ "$current_dir" != "/" ]]; do
+ if [[ -d "$current_dir/.github" ]]; then
+ project_root="$current_dir"
+ break
+ fi
+ current_dir="$(dirname "$current_dir")"
+done
+
+# If we didn't find project root, use current directory's parent
+if [[ -z "$project_root" ]]; then
+ project_root="$(dirname "$PWD")"
+fi
+
+# Run docker with the project root mounted
+exec docker run --rm -i -v "$project_root:$project_root" -w "$PWD" silkeh/clang:18 clang-format "${args[@]}"
+EOF
+
+# Install the wrapper
+sudo mv /tmp/clang-format-wrapper /usr/local/bin/clang-format
+sudo chmod +x /usr/local/bin/clang-format
+
+# Verify version and location
+echo "Verifying installation..."
+which clang-format
+clang-format --version
\ No newline at end of file
diff --git a/spine-c/build.sh b/spine-c/build.sh
index 5e22de200..b4ce0c8d1 100755
--- a/spine-c/build.sh
+++ b/spine-c/build.sh
@@ -32,7 +32,7 @@ fi
# Run codegen if requested
if [ "$1" = "codegen" ]; then
- npx tsx codegen/src/index.ts
+ npx -y tsx codegen/src/index.ts
# Format the generated C++ files
echo "Formatting generated C++ files..."
../formatters/format.sh cpp
diff --git a/spine-c/codegen/README.md b/spine-c/codegen/README.md
index 93a5e0906..6250b03bf 100644
--- a/spine-c/codegen/README.md
+++ b/spine-c/codegen/README.md
@@ -133,7 +133,7 @@ Generated files are output to `../src/generated/`:
# Install dependencies
npm install
-npx tsx src/index.ts
+npx -y tsx src/index.ts
# The generated files will be in ../src/generated/
```
diff --git a/spine-csharp/spine-csharp.csproj b/spine-csharp/spine-csharp.csproj
index 546174f58..3522bef16 100644
--- a/spine-csharp/spine-csharp.csproj
+++ b/spine-csharp/spine-csharp.csproj
@@ -1,113 +1,20 @@
-
-
+
+
- {94144E22-2431-4A8F-AC04-DEC22F7EDD8F}
- 9.0.21022
- 2.0
- Debug
- x86
- Library
- Properties
+ netstandard2.0
Spine
spine-csharp
- v4.8
-
-
- v4.0
- Windows
- HiDef
- 99dfd52d-8beb-4e5c-a68b-365be39e8064
- Library
-
-
- 3.5
-
-
-
- true
- bin\Debug\
- DEBUG;TRACE;WINDOWS
- true
- full
- AnyCPU
- false
- prompt
-
-
- bin\Release\
- TRACE;WINDOWS
- true
- true
- pdbonly
- AnyCPU
- false
- prompt
+ false
+ false
+
-
-
-
- 4.0
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
\ No newline at end of file
diff --git a/spine-csharp/spine-csharp.sln b/spine-csharp/spine-csharp.sln
deleted file mode 100644
index d15d71314..000000000
--- a/spine-csharp/spine-csharp.sln
+++ /dev/null
@@ -1,23 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-csharp", "spine-csharp.csproj", "{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = spine-csharp.csproj
- EndGlobalSection
-EndGlobal
diff --git a/spine-csharp/src/ColorMono.cs b/spine-csharp/src/ColorMono.cs
index fc59368e6..87f1040b3 100644
--- a/spine-csharp/src/ColorMono.cs
+++ b/spine-csharp/src/ColorMono.cs
@@ -51,7 +51,7 @@ namespace Spine {
}
public static implicit operator Color32F (Microsoft.Xna.Framework.Color xnaColor) {
- return new Color32F(xnaColor);
+ return new Color32F(xnaColor);
}
public static implicit operator Microsoft.Xna.Framework.Color (Color32F c) {
diff --git a/spine-csharp/src/IkConstraintPose.cs b/spine-csharp/src/IkConstraintPose.cs
index b5cfdc96f..b62835b0c 100644
--- a/spine-csharp/src/IkConstraintPose.cs
+++ b/spine-csharp/src/IkConstraintPose.cs
@@ -36,7 +36,7 @@ namespace Spine {
internal int bendDirection;
internal bool compress, stretch;
internal float mix, softness;
-
+
public void Set (IkConstraintPose pose) {
mix = pose.mix;
softness = pose.softness;
diff --git a/spine-flutter/example/lib/animated_login.dart b/spine-flutter/example/lib/animated_login.dart
index c7f2d3674..686e837cc 100644
--- a/spine-flutter/example/lib/animated_login.dart
+++ b/spine-flutter/example/lib/animated_login.dart
@@ -36,24 +36,28 @@ class AnimatedLogin extends StatelessWidget {
@override
Widget build(BuildContext context) {
reportLeaks();
- final controller = SpineWidgetController(onInitialized: (controller) {
- controller.skeleton.setSkinByName("nate");
- controller.skeleton.setToSetupPose();
- controller.animationState.setAnimationByName(0, "login/look-left-down", true);
- });
+ final controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.skeleton.setSkinByName("nate");
+ controller.skeleton.setToSetupPose();
+ controller.animationState.setAnimationByName(0, "login/look-left-down", true);
+ },
+ );
return Scaffold(
- appBar: AppBar(title: const Text('Animated login')),
- body: Container(
- margin: const EdgeInsets.all(15.0),
- padding: const EdgeInsets.all(3.0),
- decoration: BoxDecoration(border: Border.all(color: Colors.blueAccent)),
- child: SpineWidget.fromAsset(
- "assets/chibi/chibi-stickers.atlas",
- "assets/chibi/chibi-stickers.skel",
- controller,
- boundsProvider: SkinAndAnimationBounds(skins: ["nate"], animation: "login/look-left-down"),
- sizedByBounds: true,
- )));
+ appBar: AppBar(title: const Text('Animated login')),
+ body: Container(
+ margin: const EdgeInsets.all(15.0),
+ padding: const EdgeInsets.all(3.0),
+ decoration: BoxDecoration(border: Border.all(color: Colors.blueAccent)),
+ child: SpineWidget.fromAsset(
+ "assets/chibi/chibi-stickers.atlas",
+ "assets/chibi/chibi-stickers.skel",
+ controller,
+ boundsProvider: SkinAndAnimationBounds(skins: ["nate"], animation: "login/look-left-down"),
+ sizedByBounds: true,
+ ),
+ ),
+ );
}
}
diff --git a/spine-flutter/example/lib/animation_state_events.dart b/spine-flutter/example/lib/animation_state_events.dart
index 86641452b..b9e25e627 100644
--- a/spine-flutter/example/lib/animation_state_events.dart
+++ b/spine-flutter/example/lib/animation_state_events.dart
@@ -8,32 +8,38 @@ class AnimationStateEvents extends StatelessWidget {
@override
Widget build(BuildContext context) {
reportLeaks();
- final controller = SpineWidgetController(onInitialized: (controller) {
- controller.skeleton.setScaleX(0.5);
- controller.skeleton.setScaleY(0.5);
- controller.skeleton.findSlot("gun")?.setColor(Color(1, 0, 0, 1));
- controller.animationStateData.setDefaultMix(0.2);
- controller.animationState.setAnimationByName(0, "walk", true).setListener((type, trackEntry, event) {
- print("Walk animation event $type");
- });
- controller.animationState.addAnimationByName(0, "jump", false, 2);
- controller.animationState.addAnimationByName(0, "run", true, 0).setListener((type, trackEntry, event) {
- print("Run animation event $type");
- });
- controller.animationState.setListener((type, trackEntry, event) {
- if (type == EventType.event) {
- print(
- "User event: { name: ${event?.getData().getName()}, intValue: ${event?.getIntValue()}, floatValue: ${event?.getFloatValue()}, stringValue: ${event?.getStringValue()} }");
- }
- });
- print("Current: ${controller.animationState.getCurrent(0)?.getAnimation().getName()}");
- });
+ final controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.skeleton.setScaleX(0.5);
+ controller.skeleton.setScaleY(0.5);
+ controller.skeleton.findSlot("gun")?.setColor(Color(1, 0, 0, 1));
+ controller.animationStateData.setDefaultMix(0.2);
+ controller.animationState.setAnimationByName(0, "walk", true).setListener((type, trackEntry, event) {
+ print("Walk animation event $type");
+ });
+ controller.animationState.addAnimationByName(0, "jump", false, 2);
+ controller.animationState.addAnimationByName(0, "run", true, 0).setListener((type, trackEntry, event) {
+ print("Run animation event $type");
+ });
+ controller.animationState.setListener((type, trackEntry, event) {
+ if (type == EventType.event) {
+ print(
+ "User event: { name: ${event?.getData().getName()}, intValue: ${event?.getIntValue()}, floatValue: ${event?.getFloatValue()}, stringValue: ${event?.getStringValue()} }",
+ );
+ }
+ });
+ print("Current: ${controller.animationState.getCurrent(0)?.getAnimation().getName()}");
+ },
+ );
return Scaffold(
- appBar: AppBar(title: const Text('Animation State Listener')),
- body: Column(children: [
+ appBar: AppBar(title: const Text('Animation State Listener')),
+ body: Column(
+ children: [
const Text("See output in console!"),
- Expanded(child: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller))
- ]));
+ Expanded(child: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller)),
+ ],
+ ),
+ );
}
}
diff --git a/spine-flutter/example/lib/debug_rendering.dart b/spine-flutter/example/lib/debug_rendering.dart
index d0c9363d3..5799fd90c 100644
--- a/spine-flutter/example/lib/debug_rendering.dart
+++ b/spine-flutter/example/lib/debug_rendering.dart
@@ -38,36 +38,40 @@ class DebugRendering extends StatelessWidget {
reportLeaks();
const debugRenderer = DebugRenderer();
- final controller = SpineWidgetController(onInitialized: (controller) {
- controller.animationState.setAnimationByName(0, "walk", true);
-}, onBeforePaint: (controller, canvas) {
- // Save the current transform and other canvas state
- canvas.save();
+ final controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.animationState.setAnimationByName(0, "walk", true);
+ },
+ onBeforePaint: (controller, canvas) {
+ // Save the current transform and other canvas state
+ canvas.save();
- // Get the current canvas transform an invert it, so we can work in the
- // canvas coordinate system.
- final currentMatrix = canvas.getTransform();
- final invertedMatrix = Matrix4.tryInvert(Matrix4.fromFloat64List(currentMatrix));
- if (invertedMatrix != null) {
- canvas.transform(invertedMatrix.storage);
- }
+ // Get the current canvas transform an invert it, so we can work in the
+ // canvas coordinate system.
+ final currentMatrix = canvas.getTransform();
+ final invertedMatrix = Matrix4.tryInvert(Matrix4.fromFloat64List(currentMatrix));
+ if (invertedMatrix != null) {
+ canvas.transform(invertedMatrix.storage);
+ }
- // Draw something.
- final Paint paint = Paint()
- ..color = Colors.black
- ..strokeWidth = 2.0;
+ // Draw something.
+ final Paint paint = Paint()
+ ..color = Colors.black
+ ..strokeWidth = 2.0;
- canvas.drawLine(
- Offset(0, 0),
- Offset(canvas.getLocalClipBounds().width, canvas.getLocalClipBounds().height),
- paint,
- );
+ canvas.drawLine(
+ Offset(0, 0),
+ Offset(canvas.getLocalClipBounds().width, canvas.getLocalClipBounds().height),
+ paint,
+ );
- // Restore the old transform and canvas state
- canvas.restore();
-}, onAfterPaint: (controller, canvas, commands) {
- debugRenderer.render(controller.drawable, canvas, commands);
- });
+ // Restore the old transform and canvas state
+ canvas.restore();
+ },
+ onAfterPaint: (controller, canvas, commands) {
+ debugRenderer.render(controller.drawable, canvas, commands);
+ },
+ );
return Scaffold(
appBar: AppBar(title: const Text('Debug Renderer')),
diff --git a/spine-flutter/example/lib/dress_up.dart b/spine-flutter/example/lib/dress_up.dart
index af5a39c55..15155792e 100644
--- a/spine-flutter/example/lib/dress_up.dart
+++ b/spine-flutter/example/lib/dress_up.dart
@@ -84,23 +84,26 @@ class DressUpState extends State {
@override
Widget build(BuildContext context) {
- final controller = SpineWidgetController(onInitialized: (controller) {
- controller.animationState.setAnimationByName(0, "dance", true);
- });
+ final controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.animationState.setAnimationByName(0, "dance", true);
+ },
+ );
return Scaffold(
- appBar: AppBar(title: const Text('Dress Up')),
- body: _skinImages.isEmpty
- ? const SizedBox()
- : Row(children: [
+ appBar: AppBar(title: const Text('Dress Up')),
+ body: _skinImages.isEmpty
+ ? const SizedBox()
+ : Row(
+ children: [
SizedBox(
width: thumbnailSize,
child: ListView(
- children: _skinImages.keys.map((skinName) {
- var rawImageData = _skinImages[skinName]!;
- var image = Image(image: RawImageProvider(rawImageData));
- var box = SizedBox(width: 200, height: 200, child: image);
- return GestureDetector(
+ children: _skinImages.keys.map((skinName) {
+ var rawImageData = _skinImages[skinName]!;
+ var image = Image(image: RawImageProvider(rawImageData));
+ var box = SizedBox(width: 200, height: 200, child: image);
+ return GestureDetector(
onTap: () {
_toggleSkin(skinName);
setState(() {});
@@ -114,16 +117,22 @@ class DressUpState extends State {
color: Colors.grey,
backgroundBlendMode: painting.BlendMode.saturation,
),
- child: box));
- }).toList()),
+ child: box,
+ ),
+ );
+ }).toList(),
+ ),
),
Expanded(
- child: SpineWidget.fromDrawable(
- _drawable,
- controller,
- boundsProvider: SkinAndAnimationBounds(skins: ["full-skins/girl"]),
- ))
- ]));
+ child: SpineWidget.fromDrawable(
+ _drawable,
+ controller,
+ boundsProvider: SkinAndAnimationBounds(skins: ["full-skins/girl"]),
+ ),
+ ),
+ ],
+ ),
+ );
}
@override
diff --git a/spine-flutter/example/lib/flame_example.dart b/spine-flutter/example/lib/flame_example.dart
index e8e0d3986..3dff06c0f 100644
--- a/spine-flutter/example/lib/flame_example.dart
+++ b/spine-flutter/example/lib/flame_example.dart
@@ -50,8 +50,8 @@ class SpineComponent extends PositionComponent {
Anchor super.anchor = Anchor.topLeft,
super.children,
super.priority,
- }) : _ownsDrawable = ownsDrawable,
- _boundsProvider = boundsProvider {
+ }) : _ownsDrawable = ownsDrawable,
+ _boundsProvider = boundsProvider {
_drawable.update(0);
_bounds = _boundsProvider.computeBounds(_drawable);
size = Vector2(_bounds.width, _bounds.height);
@@ -69,15 +69,17 @@ class SpineComponent extends PositionComponent {
Iterable? children,
int? priority,
}) async {
- return SpineComponent(await SkeletonDrawable.fromAsset(atlasFile, skeletonFile, bundle: bundle),
- ownsDrawable: true,
- boundsProvider: boundsProvider,
- position: position,
- scale: scale,
- angle: angle,
- anchor: anchor,
- children: children,
- priority: priority);
+ return SpineComponent(
+ await SkeletonDrawable.fromAsset(atlasFile, skeletonFile, bundle: bundle),
+ ownsDrawable: true,
+ boundsProvider: boundsProvider,
+ position: position,
+ scale: scale,
+ angle: angle,
+ anchor: anchor,
+ children: children,
+ priority: priority,
+ );
}
void dispose() {
@@ -114,8 +116,13 @@ class SimpleFlameExample extends FlameGame {
// Load the Spineboy atlas and skeleton data from asset files
// and create a SpineComponent from them, scaled down and
// centered on the screen
- spineboy = await SpineComponent.fromAssets("assets/spineboy.atlas", "assets/spineboy-pro.json",
- scale: Vector2(0.4, 0.4), anchor: Anchor.center, position: Vector2(size.x / 2, size.y / 2));
+ spineboy = await SpineComponent.fromAssets(
+ "assets/spineboy.atlas",
+ "assets/spineboy-pro.json",
+ scale: Vector2(0.4, 0.4),
+ anchor: Anchor.center,
+ position: Vector2(size.x / 2, size.y / 2),
+ );
// Set the "walk" animation on track 0 in looping mode
spineboy.animationState.setAnimationByName(0, "walk", true);
@@ -137,7 +144,7 @@ class DragonExample extends FlameGame {
@override
Future onLoad() async {
cachedAtlas = await Atlas.fromAsset("assets/dragon.atlas");
- cachedSkeletonData = await SkeletonData.fromAsset(cachedAtlas, "assets/dragon-ess.skel");
+ cachedSkeletonData = await SkeletonData.fromAsset(cachedAtlas, "assets/dragon-ess.skel");
final drawable = SkeletonDrawable(cachedAtlas, cachedSkeletonData, false);
dragon = SpineComponent(
drawable,
@@ -205,6 +212,9 @@ class SpineFlameGameWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Scaffold(appBar: AppBar(title: const Text('Flame Integration')), body: GameWidget(game: game));
+ return Scaffold(
+ appBar: AppBar(title: const Text('Flame Integration')),
+ body: GameWidget(game: game),
+ );
}
}
diff --git a/spine-flutter/example/lib/ik_following.dart b/spine-flutter/example/lib/ik_following.dart
index dd1e5532d..4f6fc22c1 100644
--- a/spine-flutter/example/lib/ik_following.dart
+++ b/spine-flutter/example/lib/ik_following.dart
@@ -45,19 +45,22 @@ class IkFollowingState extends State {
void initState() {
super.initState();
- controller = SpineWidgetController(onInitialized: (controller) {
- // Set the walk animation on track 0, let it loop
- controller.animationState.setAnimationByName(0, "walk", true);
- controller.animationState.setAnimationByName(1, "aim", true);
- }, onAfterUpdateWorldTransforms: (controller) {
- final worldPosition = crossHairPosition;
- if (worldPosition == null) return;
- final bone = controller.skeleton.findBone("crosshair")!;
- final parent = bone.getParent()!;
- final position = parent.worldToLocal(worldPosition.dx, worldPosition.dy);
- bone.setX(position.x);
- bone.setY(position.y);
- });
+ controller = SpineWidgetController(
+ onInitialized: (controller) {
+ // Set the walk animation on track 0, let it loop
+ controller.animationState.setAnimationByName(0, "walk", true);
+ controller.animationState.setAnimationByName(1, "aim", true);
+ },
+ onAfterUpdateWorldTransforms: (controller) {
+ final worldPosition = crossHairPosition;
+ if (worldPosition == null) return;
+ final bone = controller.skeleton.findBone("crosshair")!;
+ final parent = bone.getParent()!;
+ final position = parent.worldToLocal(worldPosition.dx, worldPosition.dy);
+ bone.setX(position.x);
+ bone.setY(position.y);
+ },
+ );
}
void _updateBonePosition(Offset position) {
@@ -69,11 +72,17 @@ class IkFollowingState extends State {
reportLeaks();
return Scaffold(
- appBar: AppBar(title: const Text('IK Following')),
- body: GestureDetector(
- onPanDown: (drag) => _updateBonePosition(drag.localPosition),
- onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
- child: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller, alignment: Alignment.centerLeft,),
- ));
+ appBar: AppBar(title: const Text('IK Following')),
+ body: GestureDetector(
+ onPanDown: (drag) => _updateBonePosition(drag.localPosition),
+ onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
+ child: SpineWidget.fromAsset(
+ "assets/spineboy.atlas",
+ "assets/spineboy-pro.skel",
+ controller,
+ alignment: Alignment.centerLeft,
+ ),
+ ),
+ );
}
}
diff --git a/spine-flutter/example/lib/main.dart b/spine-flutter/example/lib/main.dart
index 7480e7a81..ddc899934 100644
--- a/spine-flutter/example/lib/main.dart
+++ b/spine-flutter/example/lib/main.dart
@@ -46,130 +46,96 @@ class ExampleSelector extends StatelessWidget {
Widget build(BuildContext context) {
const spacer = SizedBox(height: 10);
return Scaffold(
- appBar: AppBar(title: const Text('Spine Examples')),
- body: Center(
- child: Column(mainAxisSize: MainAxisSize.min, children: [
- ElevatedButton(
- child: const Text('Simple Animation'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const SimpleAnimation(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Pause/Play animation'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const PlayPauseAnimation(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Animation State Listener'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const AnimationStateEvents(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Debug Rendering'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const DebugRendering(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Dress Up'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const DressUp(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('IK Following'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const IkFollowing(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Physics'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => const PhysicsTest(),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Flame: Simple Example'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => SpineFlameGameWidget(SimpleFlameExample()),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Flame: Pre-load and share Spine data'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => SpineFlameGameWidget(PreloadAndShareSpineDataExample()),
- ),
- );
- },
- ),
- spacer,
- ElevatedButton(
- child: const Text('Flame: Dragon Example'),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => SpineFlameGameWidget(DragonExample()),
- ),
- );
- },
- ),
- spacer,
- ])));
+ appBar: AppBar(title: const Text('Spine Examples')),
+ body: Center(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ ElevatedButton(
+ child: const Text('Simple Animation'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const SimpleAnimation()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Pause/Play animation'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const PlayPauseAnimation()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Animation State Listener'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const AnimationStateEvents()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Debug Rendering'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const DebugRendering()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Dress Up'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const DressUp()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('IK Following'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const IkFollowing()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Physics'),
+ onPressed: () {
+ Navigator.push(context, MaterialPageRoute(builder: (context) => const PhysicsTest()));
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Flame: Simple Example'),
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) => SpineFlameGameWidget(SimpleFlameExample())),
+ );
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Flame: Pre-load and share Spine data'),
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => SpineFlameGameWidget(PreloadAndShareSpineDataExample()),
+ ),
+ );
+ },
+ ),
+ spacer,
+ ElevatedButton(
+ child: const Text('Flame: Dragon Example'),
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) => SpineFlameGameWidget(DragonExample())),
+ );
+ },
+ ),
+ spacer,
+ ],
+ ),
+ ),
+ );
}
}
diff --git a/spine-flutter/example/lib/pause_play_animation.dart b/spine-flutter/example/lib/pause_play_animation.dart
index 4ca894c9b..89df8b749 100644
--- a/spine-flutter/example/lib/pause_play_animation.dart
+++ b/spine-flutter/example/lib/pause_play_animation.dart
@@ -43,9 +43,11 @@ class PlayPauseAnimationState extends State {
@override
void initState() {
super.initState();
- controller = SpineWidgetController(onInitialized: (controller) {
- controller.animationState.setAnimationByName(0, "flying", true);
- });
+ controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.animationState.setAnimationByName(0, "flying", true);
+ },
+ );
}
void _togglePlay() {
diff --git a/spine-flutter/example/lib/physics.dart b/spine-flutter/example/lib/physics.dart
index a77f13e50..27ebdd24f 100644
--- a/spine-flutter/example/lib/physics.dart
+++ b/spine-flutter/example/lib/physics.dart
@@ -46,26 +46,29 @@ class PhysicsState extends State {
void initState() {
super.initState();
- controller = SpineWidgetController(onInitialized: (controller) {
- controller.animationState.setAnimationByName(0, "eyeblink-long", true);
- controller.animationState.setAnimationByName(1, "wings-and-feet", true);
- }, onAfterUpdateWorldTransforms: (controller) {
- if (lastMousePosition == null) {
- lastMousePosition = mousePosition;
- return;
- }
- if (mousePosition == null) {
- return;
- }
+ controller = SpineWidgetController(
+ onInitialized: (controller) {
+ controller.animationState.setAnimationByName(0, "eyeblink-long", true);
+ controller.animationState.setAnimationByName(1, "wings-and-feet", true);
+ },
+ onAfterUpdateWorldTransforms: (controller) {
+ if (lastMousePosition == null) {
+ lastMousePosition = mousePosition;
+ return;
+ }
+ if (mousePosition == null) {
+ return;
+ }
- final dx = mousePosition!.dx - lastMousePosition!.dx;
- final dy = mousePosition!.dy - lastMousePosition!.dy;
- final position = controller.skeleton.getPosition();
- position.x += dx;
- position.y += dy;
- controller.skeleton.setPosition(position.x, position.y);
- lastMousePosition = mousePosition;
- });
+ final dx = mousePosition!.dx - lastMousePosition!.dx;
+ final dy = mousePosition!.dy - lastMousePosition!.dy;
+ final position = controller.skeleton.getPosition();
+ position.x += dx;
+ position.y += dy;
+ controller.skeleton.setPosition(position.x, position.y);
+ lastMousePosition = mousePosition;
+ },
+ );
}
void _updateBonePosition(Offset position) {
@@ -77,11 +80,12 @@ class PhysicsState extends State {
reportLeaks();
return Scaffold(
- appBar: AppBar(title: const Text('Physics (drag anywhere)')),
- body: GestureDetector(
- onPanDown: (drag) => _updateBonePosition(drag.localPosition),
- onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
- child: SpineWidget.fromAsset("assets/celestial-circus.atlas", "assets/celestial-circus-pro.skel", controller),
- ));
+ appBar: AppBar(title: const Text('Physics (drag anywhere)')),
+ body: GestureDetector(
+ onPanDown: (drag) => _updateBonePosition(drag.localPosition),
+ onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
+ child: SpineWidget.fromAsset("assets/celestial-circus.atlas", "assets/celestial-circus-pro.skel", controller),
+ ),
+ );
}
}
diff --git a/spine-flutter/example/lib/simple_animation.dart b/spine-flutter/example/lib/simple_animation.dart
index d6ebf2fdb..a7f44b7cd 100644
--- a/spine-flutter/example/lib/simple_animation.dart
+++ b/spine-flutter/example/lib/simple_animation.dart
@@ -36,18 +36,20 @@ class SimpleAnimation extends StatelessWidget {
@override
Widget build(BuildContext context) {
reportLeaks();
- final controller = SpineWidgetController(onInitialized: (controller) {
- // Set the default mixing time between animations
- controller.animationState.getData().setDefaultMix(0.2);
- // Set the portal animation on track 0
- controller.animationState.setAnimationByName(0, "portal", true);
- // Queue the run animation after the portal animation
- controller.animationState.addAnimationByName(0, "run", true, 0);
- });
+ final controller = SpineWidgetController(
+ onInitialized: (controller) {
+ // Set the default mixing time between animations
+ controller.animationState.getData().setDefaultMix(0.2);
+ // Set the portal animation on track 0
+ controller.animationState.setAnimationByName(0, "portal", true);
+ // Queue the run animation after the portal animation
+ controller.animationState.addAnimationByName(0, "run", true, 0);
+ },
+ );
return Scaffold(
appBar: AppBar(title: const Text('Simple Animation')),
- body: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller)
+ body: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller),
);
}
}
diff --git a/spine-flutter/lib/init_web.dart b/spine-flutter/lib/init_web.dart
index 02e07d597..9a609e09d 100644
--- a/spine-flutter/lib/init_web.dart
+++ b/spine-flutter/lib/init_web.dart
@@ -91,8 +91,9 @@ Future initSpineFlutterFFI(bool useStaticLinkage) async {
registerOpaqueType();
await js.importLibrary('assets/packages/spine_flutter/lib/assets/libspine_flutter.js');
- Uint8List wasmBinaries =
- (await rootBundle.load('packages/spine_flutter/lib/assets/libspine_flutter.wasm')).buffer.asUint8List();
+ Uint8List wasmBinaries = (await rootBundle.load(
+ 'packages/spine_flutter/lib/assets/libspine_flutter.wasm',
+ )).buffer.asUint8List();
_module = await EmscriptenModule.compile(wasmBinaries, 'libspine_flutter');
}
Module? m = _module;
diff --git a/spine-flutter/lib/raw_image_provider.dart b/spine-flutter/lib/raw_image_provider.dart
index a0eddb29f..911a4b3bc 100644
--- a/spine-flutter/lib/raw_image_provider.dart
+++ b/spine-flutter/lib/raw_image_provider.dart
@@ -32,12 +32,7 @@ class RawImageProvider extends ImageProvider<_RawImageKey> {
final double? scale;
final int? targetWidth;
final int? targetHeight;
- RawImageProvider(
- this.image, {
- this.scale = 1.0,
- this.targetWidth,
- this.targetHeight,
- });
+ RawImageProvider(this.image, {this.scale = 1.0, this.targetWidth, this.targetHeight});
@override
ImageStreamCompleter loadImage(_RawImageKey key, ImageDecoderCallback decode) {
@@ -69,8 +64,7 @@ class RawImageProvider extends ImageProvider<_RawImageKey> {
debugPrint('ImageDescriptor: ${descriptor.width}x${descriptor.height}');
return true;
}());
- return descriptor.instantiateCodec(
- targetWidth: targetWidth, targetHeight: targetHeight);
+ return descriptor.instantiateCodec(targetWidth: targetWidth, targetHeight: targetHeight);
}
}
@@ -105,16 +99,10 @@ class RawImageData {
final int height;
final ui.PixelFormat pixelFormat;
- RawImageData(
- this.pixels,
- this.width,
- this.height, {
- this.pixelFormat = ui.PixelFormat.rgba8888,
- });
+ RawImageData(this.pixels, this.width, this.height, {this.pixelFormat = ui.PixelFormat.rgba8888});
_RawImageKey? _key;
_RawImageKey _obtainKey() {
- return _key ??=
- _RawImageKey(width, height, pixelFormat.index, md5.convert(pixels));
+ return _key ??= _RawImageKey(width, height, pixelFormat.index, md5.convert(pixels));
}
}
diff --git a/spine-flutter/lib/spine_flutter.dart b/spine-flutter/lib/spine_flutter.dart
index 65e7c6946..d32175bd5 100644
--- a/spine-flutter/lib/spine_flutter.dart
+++ b/spine-flutter/lib/spine_flutter.dart
@@ -39,7 +39,6 @@ import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:path/path.dart' as path;
-
import 'ffi_proxy.dart';
import 'init.dart' if (dart.library.html) 'init_web.dart';
import 'spine_flutter_bindings_generated.dart';
@@ -137,9 +136,13 @@ class Atlas {
Map paints = {};
for (final blendMode in BlendMode.values) {
paints[blendMode] = Paint()
- ..shader = ImageShader(image, TileMode.clamp, TileMode.clamp, Matrix4
- .identity()
- .storage, filterQuality: Atlas.filterQuality)
+ ..shader = ImageShader(
+ image,
+ TileMode.clamp,
+ TileMode.clamp,
+ Matrix4.identity().storage,
+ filterQuality: Atlas.filterQuality,
+ )
..isAntiAlias = true
..blendMode = blendMode.canvasBlendMode;
}
@@ -747,8 +750,12 @@ class BoneData {
/// rendered at runtime.
Color getColor() {
final color = _bindings.spine_bone_data_get_color(_data);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -797,7 +804,15 @@ class Bone {
///
/// See [World transform](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
/// Runtimes Guide.
- void updateWorldTransformWith(double x, double y, double rotation, double scaleX, double scaleY, double shearX, double shearY) {
+ void updateWorldTransformWith(
+ double x,
+ double y,
+ double rotation,
+ double scaleX,
+ double scaleY,
+ double shearX,
+ double shearY,
+ ) {
_bindings.spine_bone_update_world_transform_with(_bone, x, y, rotation, scaleX, scaleY, shearX, shearY);
}
@@ -1123,8 +1138,12 @@ class SlotData {
/// color tinting.
Color getColor() {
final color = _bindings.spine_slot_data_get_color(_data);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1135,8 +1154,12 @@ class SlotData {
/// color's alpha is not used.
Color getDarkColor() {
final color = _bindings.spine_slot_data_get_dark_color(_data);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setDarkColor(double r, double g, double b, double a) {
@@ -1211,8 +1234,12 @@ class Slot {
/// color tinting.
Color getColor() {
final color = _bindings.spine_slot_get_color(_slot);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(Color color) {
@@ -1223,8 +1250,12 @@ class Slot {
/// color's alpha is not used.
Color getDarkColor() {
final color = _bindings.spine_slot_get_dark_color(_slot);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setDarkColor(Color color) {
@@ -1574,8 +1605,12 @@ class RegionAttachment extends Attachment {
Color getColor() {
final color = _bindings.spine_region_attachment_get_color(_attachment);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1662,7 +1697,9 @@ class VertexAttachment extends Attachment {
void setTimelineAttachment(Attachment? attachment) {
_bindings.spine_vertex_attachment_set_timeline_attachment(
- _attachment.cast(), attachment == null ? nullptr : attachment._attachment.cast());
+ _attachment.cast(),
+ attachment == null ? nullptr : attachment._attachment.cast(),
+ );
}
}
@@ -1713,8 +1750,12 @@ class MeshAttachment extends VertexAttachment {
Color getColor() {
final color = _bindings.spine_mesh_attachment_get_color(_attachment);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1798,8 +1839,12 @@ class ClippingAttachment extends VertexAttachment {
/// attachments are not usually rendered at runtime.
Color getColor() {
final color = _bindings.spine_clipping_attachment_get_color(_attachment);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1819,8 +1864,12 @@ class BoundingBoxAttachment extends VertexAttachment {
/// rendered at runtime.
Color getColor() {
final color = _bindings.spine_path_attachment_get_color(_attachment);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1919,8 +1972,12 @@ class PointAttachment extends Attachment {
/// attachments are not usually rendered at runtime.
Color getColor() {
final color = _bindings.spine_point_attachment_get_color(_attachment);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(double r, double g, double b, double a) {
@@ -1968,7 +2025,12 @@ class Skin {
/// Adds an attachment to the skin for the specified slot index and name.
void setAttachment(int slotIndex, String name, Attachment? attachment) {
final nativeName = name.toNativeUtf8(allocator: _allocator);
- _bindings.spine_skin_set_attachment(_skin, slotIndex, nativeName.cast(), attachment == null ? nullptr : attachment._attachment.cast());
+ _bindings.spine_skin_set_attachment(
+ _skin,
+ slotIndex,
+ nativeName.cast(),
+ attachment == null ? nullptr : attachment._attachment.cast(),
+ );
_allocator.free(nativeName);
}
@@ -2007,12 +2069,15 @@ class Skin {
for (int i = 0; i < numEntries; i++) {
final entry = _bindings.spine_skin_entries_get_entry(entries, i);
Pointer name = _bindings.spine_skin_entry_get_name(entry).cast();
- result.add(SkinEntry(
+ result.add(
+ SkinEntry(
_bindings.spine_skin_entry_get_slot_index(entry),
name.toDartString(),
_bindings.spine_skin_entry_get_attachment(entry).address == nullptr.address
? null
- : Attachment._toSubclass(_bindings.spine_skin_entry_get_attachment(entry))));
+ : Attachment._toSubclass(_bindings.spine_skin_entry_get_attachment(entry)),
+ ),
+ );
}
return result;
}
@@ -2836,7 +2901,11 @@ class Skeleton {
Attachment? getAttachmentByName(String slotName, String attachmentName) {
final slotNameNative = slotName.toNativeUtf8(allocator: _allocator);
final attachmentNameNative = attachmentName.toNativeUtf8(allocator: _allocator);
- final attachment = _bindings.spine_skeleton_get_attachment_by_name(_skeleton, slotNameNative.cast(), attachmentNameNative.cast());
+ final attachment = _bindings.spine_skeleton_get_attachment_by_name(
+ _skeleton,
+ slotNameNative.cast(),
+ attachmentNameNative.cast(),
+ );
_allocator.free(slotNameNative);
_allocator.free(attachmentNameNative);
if (attachment.address == nullptr.address) return null;
@@ -2898,8 +2967,12 @@ class Skeleton {
/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
Bounds getBounds() {
final nativeBounds = _bindings.spine_skeleton_get_bounds(_skeleton);
- final bounds = Bounds(_bindings.spine_bounds_get_x(nativeBounds), _bindings.spine_bounds_get_y(nativeBounds),
- _bindings.spine_bounds_get_width(nativeBounds), _bindings.spine_bounds_get_height(nativeBounds));
+ final bounds = Bounds(
+ _bindings.spine_bounds_get_x(nativeBounds),
+ _bindings.spine_bounds_get_y(nativeBounds),
+ _bindings.spine_bounds_get_width(nativeBounds),
+ _bindings.spine_bounds_get_height(nativeBounds),
+ );
return bounds;
}
@@ -2993,8 +3066,12 @@ class Skeleton {
/// The color to tint all the skeleton's attachments.
Color getColor() {
final color = _bindings.spine_skeleton_get_color(_skeleton);
- return Color(_bindings.spine_color_get_r(color), _bindings.spine_color_get_g(color), _bindings.spine_color_get_b(color),
- _bindings.spine_color_get_a(color));
+ return Color(
+ _bindings.spine_color_get_r(color),
+ _bindings.spine_color_get_g(color),
+ _bindings.spine_color_get_b(color),
+ _bindings.spine_color_get_a(color),
+ );
}
void setColor(Color color) {
@@ -3508,7 +3585,7 @@ enum EventType {
///
/// Because this event is triggered at the end of [AnimationState.apply], any animations set in response to
/// the event won't be applied until the next time the [AnimationState] is applied.
- event
+ event,
}
/// Stores the setup pose values for an [Event].
@@ -3801,7 +3878,12 @@ class AnimationState {
/// See [setAnimation].
TrackEntry setAnimationByName(int trackIndex, String animationName, bool loop) {
final animation = animationName.toNativeUtf8(allocator: _allocator);
- final entry = _bindings.spine_animation_state_set_animation_by_name(_state, trackIndex, animation.cast(), loop ? -1 : 0);
+ final entry = _bindings.spine_animation_state_set_animation_by_name(
+ _state,
+ trackIndex,
+ animation.cast(),
+ loop ? -1 : 0,
+ );
_allocator.free(animation);
if (entry.address == nullptr.address) throw Exception("Couldn't set animation $animationName");
return TrackEntry._(entry, this);
@@ -3816,7 +3898,12 @@ class AnimationState {
/// Returns a track entry to allow further customization of animation playback. References to the track entry must not be kept
/// after the [EventType.dispose] event occurs.
TrackEntry setAnimation(int trackIndex, Animation animation, bool loop) {
- final entry = _bindings.spine_animation_state_set_animation(_state, trackIndex, animation._animation, loop ? -1 : 0);
+ final entry = _bindings.spine_animation_state_set_animation(
+ _state,
+ trackIndex,
+ animation._animation,
+ loop ? -1 : 0,
+ );
if (entry.address == nullptr.address) throw Exception("Couldn't set animation ${animation.getName()}");
return TrackEntry._(entry, this);
}
@@ -3826,7 +3913,13 @@ class AnimationState {
/// See [addAnimation].
TrackEntry addAnimationByName(int trackIndex, String animationName, bool loop, double delay) {
final animation = animationName.toNativeUtf8(allocator: _allocator);
- final entry = _bindings.spine_animation_state_add_animation_by_name(_state, trackIndex, animation.cast(), loop ? -1 : 0, delay);
+ final entry = _bindings.spine_animation_state_add_animation_by_name(
+ _state,
+ trackIndex,
+ animation.cast(),
+ loop ? -1 : 0,
+ delay,
+ );
_allocator.free(animation);
if (entry.address == nullptr.address) throw Exception("Couldn't add animation $animationName");
return TrackEntry._(entry, this);
@@ -3843,7 +3936,13 @@ class AnimationState {
/// Returns a track entry to allow further customization of animation playback. References to the track entry must not be kept
/// after the [EventType.dispose] event occurs.
TrackEntry addAnimation(int trackIndex, Animation animation, bool loop, double delay) {
- final entry = _bindings.spine_animation_state_add_animation(_state, trackIndex, animation._animation, loop ? -1 : 0, delay);
+ final entry = _bindings.spine_animation_state_add_animation(
+ _state,
+ trackIndex,
+ animation._animation,
+ loop ? -1 : 0,
+ delay,
+ );
if (entry.address == nullptr.address) throw Exception("Couldn't add animation ${animation.getName()}");
return TrackEntry._(entry, this);
}
@@ -3966,8 +4065,10 @@ class SkeletonDrawable {
_drawable = _bindings.spine_skeleton_drawable_create(skeletonData._data);
skeleton = Skeleton._(_bindings.spine_skeleton_drawable_get_skeleton(_drawable));
animationStateData = AnimationStateData._(_bindings.spine_skeleton_drawable_get_animation_state_data(_drawable));
- animationState = AnimationState._(_bindings.spine_skeleton_drawable_get_animation_state(_drawable),
- _bindings.spine_skeleton_drawable_get_animation_state_events(_drawable));
+ animationState = AnimationState._(
+ _bindings.spine_skeleton_drawable_get_animation_state(_drawable),
+ _bindings.spine_skeleton_drawable_get_animation_state_events(_drawable),
+ );
skeleton.updateWorldTransform(Physics.none);
}
@@ -4030,7 +4131,11 @@ class SkeletonDrawable {
List renderToCanvas(Canvas canvas) {
var commands = render();
for (final cmd in commands) {
- canvas.drawVertices(cmd.vertices, rendering.BlendMode.modulate, atlas.atlasPagePaints[cmd.atlasPageIndex][cmd.blendMode]!);
+ canvas.drawVertices(
+ cmd.vertices,
+ rendering.BlendMode.modulate,
+ atlas.atlasPagePaints[cmd.atlasPageIndex][cmd.blendMode]!,
+ );
}
return commands;
}
@@ -4070,10 +4175,10 @@ class SkeletonDrawable {
/// Scales and centers the skeleton to fit the within the bounds of [width] and [height].
Future renderToRawImageData(double width, double height, int bgColor) async {
final recorder = renderToPictureRecorder(width, height, bgColor);
- var rawImageData =
- (await (await recorder.endRecording().toImage(width.toInt(), height.toInt())).toByteData(format: ImageByteFormat.rawRgba))!
- .buffer
- .asUint8List();
+ var rawImageData = (await (await recorder.endRecording().toImage(
+ width.toInt(),
+ height.toInt(),
+ )).toByteData(format: ImageByteFormat.rawRgba))!.buffer.asUint8List();
return RawImageData(rawImageData, width.toInt(), height.toInt());
}
@@ -4135,7 +4240,13 @@ class RenderCommand {
if (colors.isNotEmpty && colors[0] == -1) {
vertices = Vertices.raw(VertexMode.triangles, positions, textureCoordinates: uvs, indices: indices);
} else {
- vertices = Vertices.raw(VertexMode.triangles, positions, textureCoordinates: uvs, colors: colors, indices: indices);
+ vertices = Vertices.raw(
+ VertexMode.triangles,
+ positions,
+ textureCoordinates: uvs,
+ colors: colors,
+ indices: indices,
+ );
}
} else {
// On the web, rendering is done through CanvasKit, which requires copies of the native data.
@@ -4143,7 +4254,13 @@ class RenderCommand {
final uvsCopy = Float32List.fromList(uvs);
final colorsCopy = Int32List.fromList(colors);
final indicesCopy = Uint16List.fromList(indices);
- vertices = Vertices.raw(VertexMode.triangles, positionsCopy, textureCoordinates: uvsCopy, colors: colorsCopy, indices: indicesCopy);
+ vertices = Vertices.raw(
+ VertexMode.triangles,
+ positionsCopy,
+ textureCoordinates: uvsCopy,
+ colors: colorsCopy,
+ indices: indicesCopy,
+ );
}
}
}
@@ -4158,7 +4275,10 @@ class DebugRenderer {
..color = material.Colors.blue
..style = PaintingStyle.fill;
for (final bone in drawable.skeleton.getBones()) {
- canvas.drawRect(Rect.fromCenter(center: Offset(bone.getWorldX(), bone.getWorldY()), width: 5, height: 5), bonePaint);
+ canvas.drawRect(
+ Rect.fromCenter(center: Offset(bone.getWorldX(), bone.getWorldY()), width: 5, height: 5),
+ bonePaint,
+ );
}
}
}
diff --git a/spine-flutter/lib/spine_flutter_bindings_generated.dart b/spine-flutter/lib/spine_flutter_bindings_generated.dart
index 2f38c9b1c..679d09ead 100644
--- a/spine-flutter/lib/spine_flutter_bindings_generated.dart
+++ b/spine-flutter/lib/spine_flutter_bindings_generated.dart
@@ -14,1426 +14,926 @@ import 'ffi_proxy.dart' as ffi;
///
class SpineFlutterBindings {
/// Holds the symbol lookup function.
- final ffi.Pointer Function(String symbolName)
- _lookup;
+ final ffi.Pointer Function(String symbolName) _lookup;
/// The symbols are looked up in [dynamicLibrary].
- SpineFlutterBindings(ffi.DynamicLibrary dynamicLibrary)
- : _lookup = dynamicLibrary.lookup;
+ SpineFlutterBindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
- SpineFlutterBindings.fromLookup(
- ffi.Pointer Function(String symbolName)
- lookup)
- : _lookup = lookup;
+ SpineFlutterBindings.fromLookup(ffi.Pointer Function(String symbolName) lookup)
+ : _lookup = lookup;
int spine_major_version() {
return _spine_major_version();
}
- late final _spine_major_versionPtr =
- _lookup>('spine_major_version');
- late final _spine_major_version =
- _spine_major_versionPtr.asFunction();
+ late final _spine_major_versionPtr = _lookup>('spine_major_version');
+ late final _spine_major_version = _spine_major_versionPtr.asFunction();
int spine_minor_version() {
return _spine_minor_version();
}
- late final _spine_minor_versionPtr =
- _lookup>('spine_minor_version');
- late final _spine_minor_version =
- _spine_minor_versionPtr.asFunction();
+ late final _spine_minor_versionPtr = _lookup>('spine_minor_version');
+ late final _spine_minor_version = _spine_minor_versionPtr.asFunction();
- void spine_enable_debug_extension(
- int enable,
- ) {
- return _spine_enable_debug_extension(
- enable,
- );
+ void spine_enable_debug_extension(int enable) {
+ return _spine_enable_debug_extension(enable);
}
- late final _spine_enable_debug_extensionPtr =
- _lookup>(
- 'spine_enable_debug_extension');
- late final _spine_enable_debug_extension =
- _spine_enable_debug_extensionPtr.asFunction();
+ late final _spine_enable_debug_extensionPtr = _lookup>(
+ 'spine_enable_debug_extension',
+ );
+ late final _spine_enable_debug_extension = _spine_enable_debug_extensionPtr.asFunction();
void spine_report_leaks() {
return _spine_report_leaks();
}
- late final _spine_report_leaksPtr =
- _lookup>('spine_report_leaks');
- late final _spine_report_leaks =
- _spine_report_leaksPtr.asFunction();
+ late final _spine_report_leaksPtr = _lookup>('spine_report_leaks');
+ late final _spine_report_leaks = _spine_report_leaksPtr.asFunction();
- double spine_color_get_r(
- spine_color color,
- ) {
- return _spine_color_get_r(
- color,
- );
+ double spine_color_get_r(spine_color color) {
+ return _spine_color_get_r(color);
}
- late final _spine_color_get_rPtr =
- _lookup>(
- 'spine_color_get_r');
- late final _spine_color_get_r =
- _spine_color_get_rPtr.asFunction();
+ late final _spine_color_get_rPtr = _lookup>('spine_color_get_r');
+ late final _spine_color_get_r = _spine_color_get_rPtr.asFunction();
- double spine_color_get_g(
- spine_color color,
- ) {
- return _spine_color_get_g(
- color,
- );
+ double spine_color_get_g(spine_color color) {
+ return _spine_color_get_g(color);
}
- late final _spine_color_get_gPtr =
- _lookup>(
- 'spine_color_get_g');
- late final _spine_color_get_g =
- _spine_color_get_gPtr.asFunction();
+ late final _spine_color_get_gPtr = _lookup>('spine_color_get_g');
+ late final _spine_color_get_g = _spine_color_get_gPtr.asFunction();
- double spine_color_get_b(
- spine_color color,
- ) {
- return _spine_color_get_b(
- color,
- );
+ double spine_color_get_b(spine_color color) {
+ return _spine_color_get_b(color);
}
- late final _spine_color_get_bPtr =
- _lookup>(
- 'spine_color_get_b');
- late final _spine_color_get_b =
- _spine_color_get_bPtr.asFunction();
+ late final _spine_color_get_bPtr = _lookup>('spine_color_get_b');
+ late final _spine_color_get_b = _spine_color_get_bPtr.asFunction();
- double spine_color_get_a(
- spine_color color,
- ) {
- return _spine_color_get_a(
- color,
- );
+ double spine_color_get_a(spine_color color) {
+ return _spine_color_get_a(color);
}
- late final _spine_color_get_aPtr =
- _lookup>(
- 'spine_color_get_a');
- late final _spine_color_get_a =
- _spine_color_get_aPtr.asFunction();
+ late final _spine_color_get_aPtr = _lookup>('spine_color_get_a');
+ late final _spine_color_get_a = _spine_color_get_aPtr.asFunction();
- double spine_bounds_get_x(
- spine_bounds bounds,
- ) {
- return _spine_bounds_get_x(
- bounds,
- );
+ double spine_bounds_get_x(spine_bounds bounds) {
+ return _spine_bounds_get_x(bounds);
}
- late final _spine_bounds_get_xPtr =
- _lookup>(
- 'spine_bounds_get_x');
- late final _spine_bounds_get_x =
- _spine_bounds_get_xPtr.asFunction();
+ late final _spine_bounds_get_xPtr = _lookup>(
+ 'spine_bounds_get_x',
+ );
+ late final _spine_bounds_get_x = _spine_bounds_get_xPtr.asFunction();
- double spine_bounds_get_y(
- spine_bounds bounds,
- ) {
- return _spine_bounds_get_y(
- bounds,
- );
+ double spine_bounds_get_y(spine_bounds bounds) {
+ return _spine_bounds_get_y(bounds);
}
- late final _spine_bounds_get_yPtr =
- _lookup>(
- 'spine_bounds_get_y');
- late final _spine_bounds_get_y =
- _spine_bounds_get_yPtr.asFunction();
+ late final _spine_bounds_get_yPtr = _lookup>(
+ 'spine_bounds_get_y',
+ );
+ late final _spine_bounds_get_y = _spine_bounds_get_yPtr.asFunction();
- double spine_bounds_get_width(
- spine_bounds bounds,
- ) {
- return _spine_bounds_get_width(
- bounds,
- );
+ double spine_bounds_get_width(spine_bounds bounds) {
+ return _spine_bounds_get_width(bounds);
}
- late final _spine_bounds_get_widthPtr =
- _lookup>(
- 'spine_bounds_get_width');
- late final _spine_bounds_get_width =
- _spine_bounds_get_widthPtr.asFunction();
+ late final _spine_bounds_get_widthPtr = _lookup>(
+ 'spine_bounds_get_width',
+ );
+ late final _spine_bounds_get_width = _spine_bounds_get_widthPtr.asFunction();
- double spine_bounds_get_height(
- spine_bounds bounds,
- ) {
- return _spine_bounds_get_height(
- bounds,
- );
+ double spine_bounds_get_height(spine_bounds bounds) {
+ return _spine_bounds_get_height(bounds);
}
- late final _spine_bounds_get_heightPtr =
- _lookup>(
- 'spine_bounds_get_height');
- late final _spine_bounds_get_height =
- _spine_bounds_get_heightPtr.asFunction();
+ late final _spine_bounds_get_heightPtr = _lookup>(
+ 'spine_bounds_get_height',
+ );
+ late final _spine_bounds_get_height = _spine_bounds_get_heightPtr.asFunction();
- double spine_vector_get_x(
- spine_vector vector,
- ) {
- return _spine_vector_get_x(
- vector,
- );
+ double spine_vector_get_x(spine_vector vector) {
+ return _spine_vector_get_x(vector);
}
- late final _spine_vector_get_xPtr =
- _lookup>(
- 'spine_vector_get_x');
- late final _spine_vector_get_x =
- _spine_vector_get_xPtr.asFunction();
+ late final _spine_vector_get_xPtr = _lookup>(
+ 'spine_vector_get_x',
+ );
+ late final _spine_vector_get_x = _spine_vector_get_xPtr.asFunction();
- double spine_vector_get_y(
- spine_vector vector,
- ) {
- return _spine_vector_get_y(
- vector,
- );
+ double spine_vector_get_y(spine_vector vector) {
+ return _spine_vector_get_y(vector);
}
- late final _spine_vector_get_yPtr =
- _lookup>(
- 'spine_vector_get_y');
- late final _spine_vector_get_y =
- _spine_vector_get_yPtr.asFunction();
+ late final _spine_vector_get_yPtr = _lookup>(
+ 'spine_vector_get_y',
+ );
+ late final _spine_vector_get_y = _spine_vector_get_yPtr.asFunction();
- spine_atlas spine_atlas_load(
- ffi.Pointer atlasData,
- ) {
- return _spine_atlas_load(
- atlasData,
- );
+ spine_atlas spine_atlas_load(ffi.Pointer atlasData) {
+ return _spine_atlas_load(atlasData);
}
- late final _spine_atlas_loadPtr =
- _lookup)>>(
- 'spine_atlas_load');
- late final _spine_atlas_load = _spine_atlas_loadPtr
- .asFunction)>();
+ late final _spine_atlas_loadPtr = _lookup)>>(
+ 'spine_atlas_load',
+ );
+ late final _spine_atlas_load = _spine_atlas_loadPtr.asFunction)>();
- int spine_atlas_get_num_image_paths(
- spine_atlas atlas,
- ) {
- return _spine_atlas_get_num_image_paths(
- atlas,
- );
+ int spine_atlas_get_num_image_paths(spine_atlas atlas) {
+ return _spine_atlas_get_num_image_paths(atlas);
}
- late final _spine_atlas_get_num_image_pathsPtr =
- _lookup>(
- 'spine_atlas_get_num_image_paths');
- late final _spine_atlas_get_num_image_paths =
- _spine_atlas_get_num_image_pathsPtr
- .asFunction();
+ late final _spine_atlas_get_num_image_pathsPtr = _lookup>(
+ 'spine_atlas_get_num_image_paths',
+ );
+ late final _spine_atlas_get_num_image_paths = _spine_atlas_get_num_image_pathsPtr
+ .asFunction();
- ffi.Pointer spine_atlas_get_image_path(
- spine_atlas atlas,
- int index,
- ) {
- return _spine_atlas_get_image_path(
- atlas,
- index,
- );
+ ffi.Pointer spine_atlas_get_image_path(spine_atlas atlas, int index) {
+ return _spine_atlas_get_image_path(atlas, index);
}
- late final _spine_atlas_get_image_pathPtr = _lookup<
- ffi
- .NativeFunction Function(spine_atlas, ffi.Int32)>>(
- 'spine_atlas_get_image_path');
+ late final _spine_atlas_get_image_pathPtr =
+ _lookup Function(spine_atlas, ffi.Int32)>>('spine_atlas_get_image_path');
late final _spine_atlas_get_image_path = _spine_atlas_get_image_pathPtr
.asFunction Function(spine_atlas, int)>();
- ffi.Pointer spine_atlas_get_error(
- spine_atlas atlas,
- ) {
- return _spine_atlas_get_error(
- atlas,
- );
+ ffi.Pointer spine_atlas_get_error(spine_atlas atlas) {
+ return _spine_atlas_get_error(atlas);
}
- late final _spine_atlas_get_errorPtr =
- _lookup Function(spine_atlas)>>(
- 'spine_atlas_get_error');
- late final _spine_atlas_get_error = _spine_atlas_get_errorPtr
- .asFunction Function(spine_atlas)>();
+ late final _spine_atlas_get_errorPtr = _lookup Function(spine_atlas)>>(
+ 'spine_atlas_get_error',
+ );
+ late final _spine_atlas_get_error = _spine_atlas_get_errorPtr.asFunction Function(spine_atlas)>();
- void spine_atlas_dispose(
- spine_atlas atlas,
- ) {
- return _spine_atlas_dispose(
- atlas,
- );
+ void spine_atlas_dispose(spine_atlas atlas) {
+ return _spine_atlas_dispose(atlas);
}
- late final _spine_atlas_disposePtr =
- _lookup>(
- 'spine_atlas_dispose');
- late final _spine_atlas_dispose =
- _spine_atlas_disposePtr.asFunction();
+ late final _spine_atlas_disposePtr = _lookup>(
+ 'spine_atlas_dispose',
+ );
+ late final _spine_atlas_dispose = _spine_atlas_disposePtr.asFunction();
- spine_skeleton_data_result spine_skeleton_data_load_json(
- spine_atlas atlas,
- ffi.Pointer skeletonData,
- ) {
- return _spine_skeleton_data_load_json(
- atlas,
- skeletonData,
- );
+ spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, ffi.Pointer skeletonData) {
+ return _spine_skeleton_data_load_json(atlas, skeletonData);
}
- late final _spine_skeleton_data_load_jsonPtr = _lookup<
- ffi.NativeFunction<
- spine_skeleton_data_result Function(spine_atlas,
- ffi.Pointer)>>('spine_skeleton_data_load_json');
- late final _spine_skeleton_data_load_json =
- _spine_skeleton_data_load_jsonPtr.asFunction<
- spine_skeleton_data_result Function(
- spine_atlas, ffi.Pointer)>();
+ late final _spine_skeleton_data_load_jsonPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_load_json',
+ );
+ late final _spine_skeleton_data_load_json = _spine_skeleton_data_load_jsonPtr
+ .asFunction)>();
spine_skeleton_data_result spine_skeleton_data_load_binary(
spine_atlas atlas,
ffi.Pointer skeletonData,
int length,
) {
- return _spine_skeleton_data_load_binary(
- atlas,
- skeletonData,
- length,
- );
+ return _spine_skeleton_data_load_binary(atlas, skeletonData, length);
}
- late final _spine_skeleton_data_load_binaryPtr = _lookup<
- ffi.NativeFunction<
- spine_skeleton_data_result Function(
- spine_atlas,
- ffi.Pointer,
- ffi.Int32)>>('spine_skeleton_data_load_binary');
- late final _spine_skeleton_data_load_binary =
- _spine_skeleton_data_load_binaryPtr.asFunction<
- spine_skeleton_data_result Function(
- spine_atlas, ffi.Pointer, int)>();
+ late final _spine_skeleton_data_load_binaryPtr =
+ _lookup, ffi.Int32)>>(
+ 'spine_skeleton_data_load_binary',
+ );
+ late final _spine_skeleton_data_load_binary = _spine_skeleton_data_load_binaryPtr
+ .asFunction, int)>();
- ffi.Pointer spine_skeleton_data_result_get_error(
- spine_skeleton_data_result result,
- ) {
- return _spine_skeleton_data_result_get_error(
- result,
- );
+ ffi.Pointer spine_skeleton_data_result_get_error(spine_skeleton_data_result result) {
+ return _spine_skeleton_data_result_get_error(result);
}
- late final _spine_skeleton_data_result_get_errorPtr = _lookup<
- ffi.NativeFunction<
- ffi.Pointer Function(spine_skeleton_data_result)>>(
- 'spine_skeleton_data_result_get_error');
- late final _spine_skeleton_data_result_get_error =
- _spine_skeleton_data_result_get_errorPtr
- .asFunction Function(spine_skeleton_data_result)>();
+ late final _spine_skeleton_data_result_get_errorPtr =
+ _lookup Function(spine_skeleton_data_result)>>(
+ 'spine_skeleton_data_result_get_error',
+ );
+ late final _spine_skeleton_data_result_get_error = _spine_skeleton_data_result_get_errorPtr
+ .asFunction Function(spine_skeleton_data_result)>();
- spine_skeleton_data spine_skeleton_data_result_get_data(
- spine_skeleton_data_result result,
- ) {
- return _spine_skeleton_data_result_get_data(
- result,
- );
+ spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result) {
+ return _spine_skeleton_data_result_get_data(result);
}
- late final _spine_skeleton_data_result_get_dataPtr = _lookup<
- ffi.NativeFunction<
- spine_skeleton_data Function(spine_skeleton_data_result)>>(
- 'spine_skeleton_data_result_get_data');
- late final _spine_skeleton_data_result_get_data =
- _spine_skeleton_data_result_get_dataPtr.asFunction<
- spine_skeleton_data Function(spine_skeleton_data_result)>();
+ late final _spine_skeleton_data_result_get_dataPtr =
+ _lookup>(
+ 'spine_skeleton_data_result_get_data',
+ );
+ late final _spine_skeleton_data_result_get_data = _spine_skeleton_data_result_get_dataPtr
+ .asFunction();
- void spine_skeleton_data_result_dispose(
- spine_skeleton_data_result result,
- ) {
- return _spine_skeleton_data_result_dispose(
- result,
- );
+ void spine_skeleton_data_result_dispose(spine_skeleton_data_result result) {
+ return _spine_skeleton_data_result_dispose(result);
}
- late final _spine_skeleton_data_result_disposePtr = _lookup<
- ffi.NativeFunction>(
- 'spine_skeleton_data_result_dispose');
- late final _spine_skeleton_data_result_dispose =
- _spine_skeleton_data_result_disposePtr
- .asFunction();
+ late final _spine_skeleton_data_result_disposePtr =
+ _lookup>('spine_skeleton_data_result_dispose');
+ late final _spine_skeleton_data_result_dispose = _spine_skeleton_data_result_disposePtr
+ .asFunction();
- spine_bone_data spine_skeleton_data_find_bone(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_bone(
- data,
- name,
- );
+ spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_bone(data, name);
}
- late final _spine_skeleton_data_find_bonePtr = _lookup<
- ffi.NativeFunction<
- spine_bone_data Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_bone');
- late final _spine_skeleton_data_find_bone =
- _spine_skeleton_data_find_bonePtr.asFunction<
- spine_bone_data Function(spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_bonePtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_bone',
+ );
+ late final _spine_skeleton_data_find_bone = _spine_skeleton_data_find_bonePtr
+ .asFunction)>();
- spine_slot_data spine_skeleton_data_find_slot(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_slot(
- data,
- name,
- );
+ spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_slot(data, name);
}
- late final _spine_skeleton_data_find_slotPtr = _lookup<
- ffi.NativeFunction<
- spine_slot_data Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_slot');
- late final _spine_skeleton_data_find_slot =
- _spine_skeleton_data_find_slotPtr.asFunction<
- spine_slot_data Function(spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_slotPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_slot',
+ );
+ late final _spine_skeleton_data_find_slot = _spine_skeleton_data_find_slotPtr
+ .asFunction)>();
- spine_skin spine_skeleton_data_find_skin(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_skin(
- data,
- name,
- );
+ spine_skin spine_skeleton_data_find_skin(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_skin(data, name);
}
- late final _spine_skeleton_data_find_skinPtr = _lookup<
- ffi.NativeFunction<
- spine_skin Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_skin');
- late final _spine_skeleton_data_find_skin =
- _spine_skeleton_data_find_skinPtr.asFunction<
- spine_skin Function(spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_skinPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_skin',
+ );
+ late final _spine_skeleton_data_find_skin = _spine_skeleton_data_find_skinPtr
+ .asFunction)>();
- spine_event_data spine_skeleton_data_find_event(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_event(
- data,
- name,
- );
+ spine_event_data spine_skeleton_data_find_event(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_event(data, name);
}
- late final _spine_skeleton_data_find_eventPtr = _lookup<
- ffi.NativeFunction<
- spine_event_data Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_event');
- late final _spine_skeleton_data_find_event =
- _spine_skeleton_data_find_eventPtr.asFunction<
- spine_event_data Function(spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_eventPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_event',
+ );
+ late final _spine_skeleton_data_find_event = _spine_skeleton_data_find_eventPtr
+ .asFunction)>();
- spine_animation spine_skeleton_data_find_animation(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_animation(
- data,
- name,
- );
+ spine_animation spine_skeleton_data_find_animation(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_animation(data, name);
}
- late final _spine_skeleton_data_find_animationPtr = _lookup<
- ffi.NativeFunction<
- spine_animation Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_animation');
- late final _spine_skeleton_data_find_animation =
- _spine_skeleton_data_find_animationPtr.asFunction<
- spine_animation Function(spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_animationPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_animation',
+ );
+ late final _spine_skeleton_data_find_animation = _spine_skeleton_data_find_animationPtr
+ .asFunction)>();
- spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(
- spine_skeleton_data data,
- ffi.Pointer name,
- ) {
- return _spine_skeleton_data_find_ik_constraint(
- data,
- name,
- );
+ spine_ik_constraint_data spine_skeleton_data_find_ik_constraint(spine_skeleton_data data, ffi.Pointer name) {
+ return _spine_skeleton_data_find_ik_constraint(data, name);
}
- late final _spine_skeleton_data_find_ik_constraintPtr = _lookup<
- ffi.NativeFunction<
- spine_ik_constraint_data Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_ik_constraint');
- late final _spine_skeleton_data_find_ik_constraint =
- _spine_skeleton_data_find_ik_constraintPtr.asFunction<
- spine_ik_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_ik_constraintPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_ik_constraint',
+ );
+ late final _spine_skeleton_data_find_ik_constraint = _spine_skeleton_data_find_ik_constraintPtr
+ .asFunction)>();
spine_transform_constraint_data spine_skeleton_data_find_transform_constraint(
spine_skeleton_data data,
ffi.Pointer name,
) {
- return _spine_skeleton_data_find_transform_constraint(
- data,
- name,
- );
+ return _spine_skeleton_data_find_transform_constraint(data, name);
}
- late final _spine_skeleton_data_find_transform_constraintPtr = _lookup<
- ffi.NativeFunction<
- spine_transform_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>>(
- 'spine_skeleton_data_find_transform_constraint');
- late final _spine_skeleton_data_find_transform_constraint =
- _spine_skeleton_data_find_transform_constraintPtr.asFunction<
- spine_transform_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_transform_constraintPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_transform_constraint',
+ );
+ late final _spine_skeleton_data_find_transform_constraint = _spine_skeleton_data_find_transform_constraintPtr
+ .asFunction)>();
spine_path_constraint_data spine_skeleton_data_find_path_constraint(
spine_skeleton_data data,
ffi.Pointer name,
) {
- return _spine_skeleton_data_find_path_constraint(
- data,
- name,
- );
+ return _spine_skeleton_data_find_path_constraint(data, name);
}
- late final _spine_skeleton_data_find_path_constraintPtr = _lookup<
- ffi.NativeFunction<
- spine_path_constraint_data Function(spine_skeleton_data,
- ffi.Pointer)>>('spine_skeleton_data_find_path_constraint');
- late final _spine_skeleton_data_find_path_constraint =
- _spine_skeleton_data_find_path_constraintPtr.asFunction<
- spine_path_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_path_constraintPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_path_constraint',
+ );
+ late final _spine_skeleton_data_find_path_constraint = _spine_skeleton_data_find_path_constraintPtr
+ .asFunction)>();
spine_physics_constraint_data spine_skeleton_data_find_physics_constraint(
spine_skeleton_data data,
ffi.Pointer name,
) {
- return _spine_skeleton_data_find_physics_constraint(
- data,
- name,
- );
+ return _spine_skeleton_data_find_physics_constraint(data, name);
}
- late final _spine_skeleton_data_find_physics_constraintPtr = _lookup<
- ffi.NativeFunction<
- spine_physics_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>>(
- 'spine_skeleton_data_find_physics_constraint');
- late final _spine_skeleton_data_find_physics_constraint =
- _spine_skeleton_data_find_physics_constraintPtr.asFunction<
- spine_physics_constraint_data Function(
- spine_skeleton_data, ffi.Pointer)>();
+ late final _spine_skeleton_data_find_physics_constraintPtr =
+ _lookup)>>(
+ 'spine_skeleton_data_find_physics_constraint',
+ );
+ late final _spine_skeleton_data_find_physics_constraint = _spine_skeleton_data_find_physics_constraintPtr
+ .asFunction)>();
- ffi.Pointer spine_skeleton_data_get_name(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_name(
- data,
- );
+ ffi.Pointer spine_skeleton_data_get_name(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_name(data);
}
- late final _spine_skeleton_data_get_namePtr = _lookup<
- ffi.NativeFunction Function(spine_skeleton_data)>>(
- 'spine_skeleton_data_get_name');
+ late final _spine_skeleton_data_get_namePtr =
+ _lookup Function(spine_skeleton_data)>>('spine_skeleton_data_get_name');
late final _spine_skeleton_data_get_name = _spine_skeleton_data_get_namePtr
.asFunction Function(spine_skeleton_data)>();
/// OMITTED setName()
- int spine_skeleton_data_get_num_bones(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_num_bones(
- data,
- );
+ int spine_skeleton_data_get_num_bones(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_num_bones(data);
}
late final _spine_skeleton_data_get_num_bonesPtr =
- _lookup>(
- 'spine_skeleton_data_get_num_bones');
- late final _spine_skeleton_data_get_num_bones =
- _spine_skeleton_data_get_num_bonesPtr
- .asFunction();
+ _lookup>('spine_skeleton_data_get_num_bones');
+ late final _spine_skeleton_data_get_num_bones = _spine_skeleton_data_get_num_bonesPtr
+ .asFunction();
- ffi.Pointer spine_skeleton_data_get_bones(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_bones(
- data,
- );
+ ffi.Pointer spine_skeleton_data_get_bones(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_bones(data);
}
- late final _spine_skeleton_data_get_bonesPtr = _lookup<
- ffi.NativeFunction<
- ffi.Pointer Function(
- spine_skeleton_data)>>('spine_skeleton_data_get_bones');
+ late final _spine_skeleton_data_get_bonesPtr =
+ _lookup Function(spine_skeleton_data)>>(
+ 'spine_skeleton_data_get_bones',
+ );
late final _spine_skeleton_data_get_bones = _spine_skeleton_data_get_bonesPtr
.asFunction Function(spine_skeleton_data)>();
- int spine_skeleton_data_get_num_slots(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_num_slots(
- data,
- );
+ int spine_skeleton_data_get_num_slots(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_num_slots(data);
}
late final _spine_skeleton_data_get_num_slotsPtr =
- _lookup>(
- 'spine_skeleton_data_get_num_slots');
- late final _spine_skeleton_data_get_num_slots =
- _spine_skeleton_data_get_num_slotsPtr
- .asFunction();
+ _lookup>('spine_skeleton_data_get_num_slots');
+ late final _spine_skeleton_data_get_num_slots = _spine_skeleton_data_get_num_slotsPtr
+ .asFunction();
- ffi.Pointer spine_skeleton_data_get_slots(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_slots(
- data,
- );
+ ffi.Pointer spine_skeleton_data_get_slots(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_slots(data);
}
- late final _spine_skeleton_data_get_slotsPtr = _lookup<
- ffi.NativeFunction<
- ffi.Pointer Function(
- spine_skeleton_data)>>('spine_skeleton_data_get_slots');
+ late final _spine_skeleton_data_get_slotsPtr =
+ _lookup Function(spine_skeleton_data)>>(
+ 'spine_skeleton_data_get_slots',
+ );
late final _spine_skeleton_data_get_slots = _spine_skeleton_data_get_slotsPtr
.asFunction Function(spine_skeleton_data)>();
- int spine_skeleton_data_get_num_skins(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_num_skins(
- data,
- );
+ int spine_skeleton_data_get_num_skins(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_num_skins(data);
}
late final _spine_skeleton_data_get_num_skinsPtr =
- _lookup>(
- 'spine_skeleton_data_get_num_skins');
- late final _spine_skeleton_data_get_num_skins =
- _spine_skeleton_data_get_num_skinsPtr
- .asFunction();
+ _lookup>('spine_skeleton_data_get_num_skins');
+ late final _spine_skeleton_data_get_num_skins = _spine_skeleton_data_get_num_skinsPtr
+ .asFunction();
- ffi.Pointer spine_skeleton_data_get_skins(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_skins(
- data,
- );
+ ffi.Pointer spine_skeleton_data_get_skins(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_skins(data);
}
- late final _spine_skeleton_data_get_skinsPtr = _lookup<
- ffi.NativeFunction<
- ffi.Pointer Function(
- spine_skeleton_data)>>('spine_skeleton_data_get_skins');
+ late final _spine_skeleton_data_get_skinsPtr =
+ _lookup Function(spine_skeleton_data)>>(
+ 'spine_skeleton_data_get_skins',
+ );
late final _spine_skeleton_data_get_skins = _spine_skeleton_data_get_skinsPtr
.asFunction Function(spine_skeleton_data)>();
- spine_skin spine_skeleton_data_get_default_skin(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_default_skin(
- data,
- );
+ spine_skin spine_skeleton_data_get_default_skin(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_default_skin(data);
}
late final _spine_skeleton_data_get_default_skinPtr =
- _lookup>(
- 'spine_skeleton_data_get_default_skin');
- late final _spine_skeleton_data_get_default_skin =
- _spine_skeleton_data_get_default_skinPtr
- .asFunction();
+ _lookup>('spine_skeleton_data_get_default_skin');
+ late final _spine_skeleton_data_get_default_skin = _spine_skeleton_data_get_default_skinPtr
+ .asFunction();
- void spine_skeleton_data_set_default_skin(
- spine_skeleton_data data,
- spine_skin skin,
- ) {
- return _spine_skeleton_data_set_default_skin(
- data,
- skin,
- );
+ void spine_skeleton_data_set_default_skin(spine_skeleton_data data, spine_skin skin) {
+ return _spine_skeleton_data_set_default_skin(data, skin);
}
- late final _spine_skeleton_data_set_default_skinPtr = _lookup<
- ffi
- .NativeFunction>(
- 'spine_skeleton_data_set_default_skin');
- late final _spine_skeleton_data_set_default_skin =
- _spine_skeleton_data_set_default_skinPtr
- .asFunction();
+ late final _spine_skeleton_data_set_default_skinPtr =
+ _lookup>(
+ 'spine_skeleton_data_set_default_skin',
+ );
+ late final _spine_skeleton_data_set_default_skin = _spine_skeleton_data_set_default_skinPtr
+ .asFunction();
- int spine_skeleton_data_get_num_events(
- spine_skeleton_data data,
- ) {
- return _spine_skeleton_data_get_num_events(
- data,
- );
+ int spine_skeleton_data_get_num_events(spine_skeleton_data data) {
+ return _spine_skeleton_data_get_num_events(data);
}
late final _spine_skeleton_data_get_num_eventsPtr =
- _lookup>(
- 'spine_skeleton_data_get_num_events');
- late final _spine_skeleton_data_get_num_events =
- _spine_skeleton_data_get_num_eventsPtr
- .asFunction();
+ _lookup>('spine_skeleton_data_get_num_events');
+ late final _spine_skeleton_data_get_num_events = _spine_skeleton_data_get_num_eventsPtr
+ .asFunction