sfml.js 0.0.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.ja.md +173 -0
- package/README.ko.md +173 -0
- package/README.md +129 -20
- package/README.zh-CN.md +173 -0
- package/assets/branding/sfml-js-symbol-pentagon.svg +24 -0
- package/assets/branding/sfml-js-wordmark-dark.svg +20 -0
- package/assets/branding/sfml-js-wordmark.svg +19 -0
- package/assets/breakout.png +0 -0
- package/binding.gyp +95 -183
- package/dist/audio/effect-processor.d.ts +67 -0
- package/dist/audio/effect-processor.js +58 -0
- package/dist/audio/input-sound-file.d.ts +138 -0
- package/dist/audio/input-sound-file.js +253 -0
- package/dist/audio/listener.d.ts +90 -0
- package/dist/audio/listener.js +148 -0
- package/dist/audio/music.d.ts +210 -0
- package/dist/audio/music.js +353 -0
- package/dist/audio/output-sound-file.d.ts +47 -0
- package/dist/audio/output-sound-file.js +102 -0
- package/dist/audio/playback-device.d.ts +121 -0
- package/dist/audio/playback-device.js +152 -0
- package/dist/audio/sound-buffer-recorder.d.ts +114 -0
- package/dist/audio/sound-buffer-recorder.js +142 -0
- package/dist/audio/sound-buffer.d.ts +150 -0
- package/dist/audio/sound-buffer.js +237 -0
- package/dist/audio/sound-file-factory.d.ts +100 -0
- package/dist/audio/sound-file-factory.js +225 -0
- package/dist/audio/sound-file-reader.d.ts +191 -0
- package/dist/audio/sound-file-reader.js +132 -0
- package/dist/audio/sound-file-writer.d.ts +59 -0
- package/dist/audio/sound-file-writer.js +20 -0
- package/dist/audio/sound-recorder.d.ts +184 -0
- package/dist/audio/sound-recorder.js +286 -0
- package/dist/audio/sound-source.d.ts +336 -0
- package/dist/audio/sound-source.js +389 -0
- package/dist/audio/sound-stream.d.ts +76 -0
- package/dist/audio/sound-stream.js +83 -0
- package/dist/audio/sound.d.ts +41 -0
- package/dist/audio/sound.js +66 -0
- package/dist/audio/value.d.ts +359 -0
- package/dist/audio/value.js +353 -0
- package/dist/audio/worker.d.ts +306 -0
- package/dist/audio/worker.js +2 -0
- package/dist/graphics/blend-mode.d.ts +248 -0
- package/dist/graphics/blend-mode.js +234 -0
- package/dist/graphics/boolean-vector.d.ts +134 -0
- package/dist/graphics/boolean-vector.js +202 -0
- package/dist/graphics/circle-shape.d.ts +84 -0
- package/dist/graphics/circle-shape.js +72 -0
- package/dist/graphics/color.d.ts +278 -0
- package/dist/graphics/color.js +291 -0
- package/dist/graphics/convex-shape.d.ts +56 -0
- package/dist/graphics/convex-shape.js +59 -0
- package/dist/graphics/drawable.d.ts +22 -0
- package/dist/graphics/drawable.js +20 -0
- package/dist/graphics/font.d.ts +199 -0
- package/dist/graphics/font.js +319 -0
- package/dist/graphics/glsl-matrix.d.ts +62 -0
- package/dist/graphics/glsl-matrix.js +106 -0
- package/dist/graphics/glsl.d.ts +165 -0
- package/dist/graphics/glsl.js +215 -0
- package/dist/graphics/glyph.d.ts +133 -0
- package/dist/graphics/glyph.js +138 -0
- package/dist/graphics/image.d.ts +192 -0
- package/dist/graphics/image.js +285 -0
- package/dist/graphics/primitive-type.d.ts +51 -0
- package/dist/graphics/primitive-type.js +60 -0
- package/dist/graphics/rect.d.ts +203 -0
- package/dist/graphics/rect.js +249 -0
- package/dist/graphics/rectangle-shape.d.ts +55 -0
- package/dist/graphics/rectangle-shape.js +60 -0
- package/dist/graphics/render-states.d.ts +188 -0
- package/dist/graphics/render-states.js +115 -0
- package/dist/graphics/render-target.d.ts +222 -0
- package/dist/graphics/render-target.js +434 -0
- package/dist/graphics/render-texture.d.ts +130 -0
- package/dist/graphics/render-texture.js +187 -0
- package/dist/graphics/render-window.d.ts +138 -0
- package/dist/graphics/render-window.js +154 -0
- package/dist/graphics/shader.d.ts +192 -0
- package/dist/graphics/shader.js +321 -0
- package/dist/graphics/shape.d.ts +189 -0
- package/dist/graphics/shape.js +277 -0
- package/dist/graphics/sprite.d.ts +104 -0
- package/dist/graphics/sprite.js +164 -0
- package/dist/graphics/stencil-mode.d.ts +230 -0
- package/dist/graphics/stencil-mode.js +173 -0
- package/dist/graphics/swap.d.ts +17 -0
- package/dist/graphics/swap.js +16 -0
- package/dist/graphics/text.d.ts +759 -0
- package/dist/graphics/text.js +724 -0
- package/dist/graphics/texture.d.ts +255 -0
- package/dist/graphics/texture.js +390 -0
- package/dist/graphics/transform.d.ts +129 -0
- package/dist/graphics/transform.js +274 -0
- package/dist/graphics/transformable.d.ts +24 -0
- package/dist/graphics/transformable.js +38 -0
- package/dist/graphics/vertex-array.d.ts +123 -0
- package/dist/graphics/vertex-array.js +234 -0
- package/dist/graphics/vertex-buffer.d.ts +205 -0
- package/dist/graphics/vertex-buffer.js +256 -0
- package/dist/graphics/vertex.d.ts +111 -0
- package/dist/graphics/vertex.js +134 -0
- package/dist/graphics/view.d.ts +172 -0
- package/dist/graphics/view.js +296 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +251 -0
- package/dist/internal/audio-codec-registry.d.ts +13 -0
- package/dist/internal/audio-codec-registry.js +64 -0
- package/dist/internal/audio-input-stream.d.ts +13 -0
- package/dist/internal/audio-input-stream.js +44 -0
- package/dist/internal/audio-music-pump.d.ts +63 -0
- package/dist/internal/audio-music-pump.js +193 -0
- package/dist/internal/audio-native.d.ts +145 -0
- package/dist/internal/audio-native.js +24 -0
- package/dist/internal/audio-recorder-session.d.ts +77 -0
- package/dist/internal/audio-recorder-session.js +182 -0
- package/dist/internal/audio-worker-session.d.ts +18 -0
- package/dist/internal/audio-worker-session.js +82 -0
- package/dist/internal/audio-worker.d.ts +1 -0
- package/dist/internal/audio-worker.js +134 -0
- package/dist/internal/glsl-value.d.ts +51 -0
- package/dist/internal/glsl-value.js +69 -0
- package/dist/internal/graphics-state.d.ts +45 -0
- package/dist/internal/graphics-state.js +123 -0
- package/dist/internal/input-stream.d.ts +4 -0
- package/dist/internal/input-stream.js +25 -0
- package/dist/internal/lazy-value.d.ts +17 -0
- package/dist/internal/lazy-value.js +43 -0
- package/dist/internal/native.d.ts +317 -0
- package/dist/internal/native.js +8 -0
- package/dist/internal/numeric-properties.d.ts +2 -0
- package/dist/internal/numeric-properties.js +39 -0
- package/dist/internal/render-states.d.ts +4 -0
- package/dist/internal/render-states.js +44 -0
- package/dist/internal/scalar.d.ts +52 -0
- package/dist/internal/scalar.js +95 -0
- package/dist/internal/shaped-glyph.d.ts +32 -0
- package/dist/internal/shaped-glyph.js +51 -0
- package/dist/internal/struct-view.d.ts +11 -0
- package/dist/internal/struct-view.js +39 -0
- package/dist/internal/text-indices.d.ts +7 -0
- package/dist/internal/text-indices.js +22 -0
- package/dist/internal/transformable.d.ts +124 -0
- package/dist/internal/transformable.js +121 -0
- package/dist/internal/value-storage.d.ts +33 -0
- package/dist/internal/value-storage.js +21 -0
- package/dist/network/common.d.ts +23 -0
- package/dist/network/common.js +78 -0
- package/dist/network/dns.d.ts +124 -0
- package/dist/network/dns.js +142 -0
- package/dist/network/ftp.d.ts +265 -0
- package/dist/network/ftp.js +417 -0
- package/dist/network/gen/constants.d.ts +878 -0
- package/dist/network/gen/constants.js +886 -0
- package/dist/network/http.d.ts +458 -0
- package/dist/network/http.js +732 -0
- package/dist/network/ip-address.d.ts +210 -0
- package/dist/network/ip-address.js +301 -0
- package/dist/network/packet.d.ts +249 -0
- package/dist/network/packet.js +326 -0
- package/dist/network/sftp.d.ts +661 -0
- package/dist/network/sftp.js +826 -0
- package/dist/network/socket-selector.d.ts +132 -0
- package/dist/network/socket-selector.js +214 -0
- package/dist/network/socket.d.ts +301 -0
- package/dist/network/socket.js +402 -0
- package/dist/network/tcp-listener.d.ts +114 -0
- package/dist/network/tcp-listener.js +199 -0
- package/dist/network/tcp-socket.d.ts +307 -0
- package/dist/network/tcp-socket.js +493 -0
- package/dist/network/tls-material.d.ts +22 -0
- package/dist/network/tls-material.js +52 -0
- package/dist/network/udp-socket.d.ts +178 -0
- package/dist/network/udp-socket.js +285 -0
- package/dist/system/angle.d.ts +77 -0
- package/dist/system/angle.js +122 -0
- package/dist/system/clock.d.ts +65 -0
- package/dist/system/clock.js +99 -0
- package/dist/system/err.d.ts +18 -0
- package/dist/system/err.js +61 -0
- package/dist/system/error.d.ts +15 -0
- package/dist/system/error.js +22 -0
- package/dist/system/file-input-stream.d.ts +68 -0
- package/dist/system/file-input-stream.js +148 -0
- package/dist/system/input-stream.d.ts +114 -0
- package/dist/system/input-stream.js +106 -0
- package/dist/system/operators.d.ts +291 -0
- package/dist/system/operators.js +505 -0
- package/dist/system/sleep.d.ts +9 -0
- package/dist/system/sleep.js +28 -0
- package/dist/system/suspend-aware-clock.d.ts +22 -0
- package/dist/system/suspend-aware-clock.js +29 -0
- package/dist/system/time.d.ts +100 -0
- package/dist/system/time.js +188 -0
- package/dist/system/timeout-with-predicate.d.ts +60 -0
- package/dist/system/timeout-with-predicate.js +52 -0
- package/dist/system/unicode.d.ts +54 -0
- package/dist/system/unicode.js +67 -0
- package/dist/system/vector2.d.ts +302 -0
- package/dist/system/vector2.js +314 -0
- package/dist/system/vector3.d.ts +249 -0
- package/dist/system/vector3.js +266 -0
- package/dist/system/version.d.ts +51 -0
- package/dist/system/version.js +24 -0
- package/dist/window/clipboard.d.ts +14 -0
- package/dist/window/clipboard.js +26 -0
- package/dist/window/context-settings.d.ts +94 -0
- package/dist/window/context-settings.js +84 -0
- package/dist/window/context.d.ts +87 -0
- package/dist/window/context.js +122 -0
- package/dist/window/cursor.d.ts +58 -0
- package/dist/window/cursor.js +80 -0
- package/dist/window/event.d.ts +529 -0
- package/dist/window/event.js +87 -0
- package/dist/window/gen/constants.d.ts +2213 -0
- package/dist/window/gen/constants.js +2227 -0
- package/dist/window/joystick.d.ts +81 -0
- package/dist/window/joystick.js +80 -0
- package/dist/window/keyboard.d.ts +50 -0
- package/dist/window/keyboard.js +59 -0
- package/dist/window/mouse.d.ts +31 -0
- package/dist/window/mouse.js +57 -0
- package/dist/window/sensor.d.ts +26 -0
- package/dist/window/sensor.js +40 -0
- package/dist/window/touch.d.ts +27 -0
- package/dist/window/touch.js +44 -0
- package/dist/window/video-mode.d.ts +77 -0
- package/dist/window/video-mode.js +99 -0
- package/dist/window/vulkan.d.ts +32 -0
- package/dist/window/vulkan.js +45 -0
- package/dist/window/window.d.ts +355 -0
- package/dist/window/window.js +434 -0
- package/docs/README.ja.md +30 -0
- package/docs/README.ko.md +30 -0
- package/docs/README.md +30 -0
- package/docs/README.zh-CN.md +30 -0
- package/docs/api.ja.md +84 -0
- package/docs/api.ko.md +84 -0
- package/docs/api.md +81 -0
- package/docs/api.zh-CN.md +81 -0
- package/docs/audio.ja.md +249 -0
- package/docs/audio.ko.md +251 -0
- package/docs/audio.md +252 -0
- package/docs/audio.zh-CN.md +252 -0
- package/docs/concepts.ja.md +130 -0
- package/docs/concepts.ko.md +130 -0
- package/docs/concepts.md +131 -0
- package/docs/concepts.zh-CN.md +131 -0
- package/docs/development.ja.md +148 -0
- package/docs/development.ko.md +148 -0
- package/docs/development.md +150 -0
- package/docs/development.zh-CN.md +150 -0
- package/docs/getting-started.ja.md +154 -0
- package/docs/getting-started.ko.md +154 -0
- package/docs/getting-started.md +156 -0
- package/docs/getting-started.zh-CN.md +156 -0
- package/docs/graphics.ja.md +256 -0
- package/docs/graphics.ko.md +254 -0
- package/docs/graphics.md +255 -0
- package/docs/graphics.zh-CN.md +257 -0
- package/docs/network.ja.md +214 -0
- package/docs/network.ko.md +216 -0
- package/docs/network.md +218 -0
- package/docs/network.zh-CN.md +218 -0
- package/docs/system.ja.md +169 -0
- package/docs/system.ko.md +171 -0
- package/docs/system.md +173 -0
- package/docs/system.zh-CN.md +173 -0
- package/docs/window.ja.md +138 -0
- package/docs/window.ko.md +140 -0
- package/docs/window.md +141 -0
- package/docs/window.zh-CN.md +141 -0
- package/native/addon.cc +129 -0
- package/native/audio-binding.cc +543 -0
- package/native/audio-codec-binding.cc +246 -0
- package/native/audio-device-binding.cc +160 -0
- package/native/audio-file-binding.cc +192 -0
- package/native/audio-recorder-binding.cc +237 -0
- package/native/audio-recorder.h +39 -0
- package/native/audio-state.h +220 -0
- package/native/audio-stream-binding.cc +284 -0
- package/native/audio-stream.h +28 -0
- package/native/audio-worker-binding.cc +447 -0
- package/native/audio-worker.h +121 -0
- package/native/batch-drawable.cc +189 -0
- package/native/batch-drawable.h +57 -0
- package/native/context-binding.cc +180 -0
- package/native/context-settings.h +74 -0
- package/native/deferred-delete.cc +49 -0
- package/native/deferred-delete.h +84 -0
- package/native/error-stream-binding.cc +270 -0
- package/native/exception-boundary.h +97 -0
- package/native/font-binding.cc +210 -0
- package/native/font-state.h +27 -0
- package/native/graphics-binding.cc +338 -0
- package/native/graphics-state.h +253 -0
- package/native/image-binding.cc +258 -0
- package/native/image-state.h +93 -0
- package/native/input-binding.cc +246 -0
- package/native/numeric-fields.h +96 -0
- package/native/render-window-binding.cc +103 -0
- package/native/render-window-state.h +22 -0
- package/native/shader-binding.cc +292 -0
- package/native/shape-binding.cc +283 -0
- package/native/shape-state.h +68 -0
- package/native/shaped-glyph-storage.h +45 -0
- package/native/shared-handle.h +69 -0
- package/native/stream-binding.cc +286 -0
- package/native/system-binding.cc +91 -0
- package/native/text-binding.cc +205 -0
- package/native/text-state.h +101 -0
- package/native/texture-binding.cc +330 -0
- package/native/texture-resource.h +52 -0
- package/native/time-value.h +28 -0
- package/native/transformable-binding.cc +23 -0
- package/native/transformable-state.h +44 -0
- package/native/value-binding.h +200 -0
- package/native/value-layout.h +116 -0
- package/native/values-binding.cc +27 -0
- package/native/vertex-binding.cc +50 -0
- package/native/vertex-buffer-binding.cc +232 -0
- package/native/vertex-storage.h +20 -0
- package/native/view-data.h +24 -0
- package/native/window-binding.cc +388 -0
- package/native/window-event.h +92 -0
- package/native/window-owner.h +81 -0
- package/package.json +87 -35
- package/src/audio/effect-processor.ts +86 -0
- package/src/audio/input-sound-file.ts +259 -0
- package/src/audio/listener.ts +136 -0
- package/src/audio/music.ts +357 -0
- package/src/audio/output-sound-file.ts +96 -0
- package/src/audio/playback-device.ts +145 -0
- package/src/audio/sound-buffer-recorder.ts +141 -0
- package/src/audio/sound-buffer.ts +275 -0
- package/src/audio/sound-file-factory.ts +235 -0
- package/src/audio/sound-file-reader.ts +224 -0
- package/src/audio/sound-file-writer.ts +61 -0
- package/src/audio/sound-recorder.ts +315 -0
- package/src/audio/sound-source.ts +396 -0
- package/src/audio/sound-stream.ts +108 -0
- package/src/audio/sound.ts +63 -0
- package/src/audio/value.ts +408 -0
- package/src/audio/worker.ts +308 -0
- package/src/graphics/blend-mode.ts +291 -0
- package/src/graphics/boolean-vector.ts +225 -0
- package/src/graphics/circle-shape.ts +113 -0
- package/src/graphics/color.ts +374 -0
- package/src/graphics/convex-shape.ts +76 -0
- package/src/graphics/drawable.ts +32 -0
- package/src/graphics/font.ts +377 -0
- package/src/graphics/glsl-matrix.ts +110 -0
- package/src/graphics/glsl.ts +229 -0
- package/src/graphics/glyph.ts +186 -0
- package/src/graphics/image.ts +366 -0
- package/src/graphics/primitive-type.ts +56 -0
- package/src/graphics/rect.ts +350 -0
- package/src/graphics/rectangle-shape.ts +76 -0
- package/src/graphics/render-states.ts +238 -0
- package/src/graphics/render-target.ts +554 -0
- package/src/graphics/render-texture.ts +234 -0
- package/src/graphics/render-window.ts +250 -0
- package/src/graphics/shader.ts +353 -0
- package/src/graphics/shape.ts +343 -0
- package/src/graphics/sprite.ts +203 -0
- package/src/graphics/stencil-mode.ts +258 -0
- package/src/graphics/swap.ts +28 -0
- package/src/graphics/text.ts +944 -0
- package/src/graphics/texture.ts +529 -0
- package/src/graphics/transform.ts +321 -0
- package/src/graphics/transformable.ts +37 -0
- package/src/graphics/vertex-array.ts +270 -0
- package/src/graphics/vertex-buffer.ts +345 -0
- package/src/graphics/vertex.ts +211 -0
- package/src/graphics/view.ts +355 -0
- package/src/index.ts +147 -0
- package/src/internal/audio-codec-registry.ts +68 -0
- package/src/internal/audio-input-stream.ts +42 -0
- package/src/internal/audio-music-pump.ts +199 -0
- package/src/internal/audio-native.ts +176 -0
- package/src/internal/audio-recorder-session.ts +234 -0
- package/src/internal/audio-worker-session.ts +89 -0
- package/src/internal/audio-worker.ts +146 -0
- package/src/internal/glsl-value.ts +79 -0
- package/src/internal/graphics-state.ts +131 -0
- package/src/internal/input-stream.ts +30 -0
- package/src/internal/lazy-value.ts +62 -0
- package/src/internal/native.ts +581 -0
- package/src/internal/numeric-properties.ts +37 -0
- package/src/internal/render-states.ts +42 -0
- package/src/internal/scalar.ts +117 -0
- package/src/internal/shaped-glyph.ts +68 -0
- package/src/internal/struct-view.ts +49 -0
- package/src/internal/text-indices.ts +19 -0
- package/src/internal/transformable.ts +260 -0
- package/src/internal/value-storage.ts +40 -0
- package/src/network/common.ts +58 -0
- package/src/network/dns.ts +191 -0
- package/src/network/ftp.ts +386 -0
- package/src/network/gen/constants.ts +879 -0
- package/src/network/http.ts +680 -0
- package/src/network/ip-address.ts +311 -0
- package/src/network/packet.ts +388 -0
- package/src/network/sftp.ts +1015 -0
- package/src/network/socket-selector.ts +206 -0
- package/src/network/socket.ts +415 -0
- package/src/network/tcp-listener.ts +193 -0
- package/src/network/tcp-socket.ts +569 -0
- package/src/network/tls-material.ts +46 -0
- package/src/network/udp-socket.ts +294 -0
- package/src/system/angle.ts +132 -0
- package/src/system/clock.ts +104 -0
- package/src/system/err.ts +58 -0
- package/src/system/error.ts +18 -0
- package/src/system/file-input-stream.ts +147 -0
- package/src/system/input-stream.ts +150 -0
- package/src/system/operators.ts +681 -0
- package/src/system/sleep.ts +25 -0
- package/src/system/suspend-aware-clock.ts +27 -0
- package/src/system/time.ts +218 -0
- package/src/system/timeout-with-predicate.ts +94 -0
- package/src/system/unicode.ts +64 -0
- package/src/system/vector2.ts +549 -0
- package/src/system/vector3.ts +433 -0
- package/src/system/version.ts +66 -0
- package/src/window/clipboard.ts +22 -0
- package/src/window/context-settings.ts +143 -0
- package/src/window/context.ts +152 -0
- package/src/window/cursor.ts +116 -0
- package/src/window/event.ts +580 -0
- package/src/window/gen/constants.ts +2231 -0
- package/src/window/joystick.ts +108 -0
- package/src/window/keyboard.ts +78 -0
- package/src/window/mouse.ts +58 -0
- package/src/window/sensor.ts +37 -0
- package/src/window/touch.ts +42 -0
- package/src/window/video-mode.ts +136 -0
- package/src/window/vulkan.ts +42 -0
- package/src/window/window.ts +579 -0
- package/test/native/audio-probes.cc +181 -0
- package/test/native/deferred-delete-probes.cc +62 -0
- package/test/native/drawable-probes.cc +168 -0
- package/test/native/exception-probes.cc +83 -0
- package/test/native/image-probes.cc +105 -0
- package/test/native/matrix-probes.cc +67 -0
- package/test/native/network-oracle.cc +32 -0
- package/test/native/render-texture-probes.cc +193 -0
- package/test/native/shader-probes.cc +69 -0
- package/test/native/shape-probes.cc +160 -0
- package/test/native/sprite-probes.cc +146 -0
- package/test/native/system-probes.cc +109 -0
- package/test/native/text-probes.cc +211 -0
- package/test/native/texture-probes.cc +200 -0
- package/test/native/time-probes.cc +143 -0
- package/test/native/transform-probes.cc +92 -0
- package/test/native/transformable-probes.cc +152 -0
- package/test/native/value-oracle.h +88 -0
- package/test/native/value-probes.cc +379 -0
- package/test/native/vertex-array-probes.cc +82 -0
- package/test/native/vertex-buffer-probes.cc +87 -0
- package/test/native/view-probes.cc +150 -0
- package/test/native/window-probes.cc +172 -0
- package/test/tsconfig.json +8 -0
- package/tools/configure-lsp.cjs +23 -0
- package/tools/constant-docs.cjs +109 -0
- package/tools/constant-docs.json +1318 -0
- package/tools/generate-network-constants.cjs +59 -0
- package/tools/generate-window-constants.cjs +178 -0
- package/tools/lib_downloader.cjs +92 -0
- package/tools/lib_downloader_urls.cjs +23 -0
- package/tsconfig.json +11 -4
- package/index.d.ts +0 -1
- package/lib/clock.d.ts +0 -8
- package/lib/clock.js +0 -5
- package/lib/color.d.ts +0 -11
- package/lib/color.js +0 -98
- package/lib/common.js +0 -47
- package/lib/drawable/circle_shape.d.ts +0 -5
- package/lib/drawable/circle_shape.js +0 -26
- package/lib/drawable/convex_shape.d.ts +0 -5
- package/lib/drawable/convex_shape.js +0 -35
- package/lib/drawable/drawable.d.ts +0 -6
- package/lib/drawable/drawable.js +0 -18
- package/lib/drawable/plugin_package.d.ts +0 -31
- package/lib/drawable/plugin_package.js +0 -102
- package/lib/drawable/rectangle_shape.d.ts +0 -9
- package/lib/drawable/rectangle_shape.js +0 -28
- package/lib/drawable/shape.d.ts +0 -14
- package/lib/drawable/shape.js +0 -30
- package/lib/drawable/sprite.d.ts +0 -17
- package/lib/drawable/sprite.js +0 -53
- package/lib/drawable/text.d.ts +0 -26
- package/lib/drawable/text.js +0 -88
- package/lib/drawable/transformable.d.ts +0 -28
- package/lib/drawable/transformable.js +0 -113
- package/lib/drawable/vertex_array.d.ts +0 -40
- package/lib/drawable/vertex_array.js +0 -128
- package/lib/font.d.ts +0 -24
- package/lib/font.js +0 -137
- package/lib/image.d.ts +0 -26
- package/lib/image.js +0 -147
- package/lib/joystick.d.ts +0 -21
- package/lib/joystick.js +0 -72
- package/lib/keyboard.d.ts +0 -113
- package/lib/keyboard.js +0 -17
- package/lib/mouse.d.ts +0 -6
- package/lib/mouse.js +0 -39
- package/lib/poll_event.d.ts +0 -138
- package/lib/rect.d.ts +0 -18
- package/lib/rect.js +0 -119
- package/lib/render_window.d.ts +0 -67
- package/lib/render_window.js +0 -197
- package/lib/sensor.d.ts +0 -12
- package/lib/sensor.js +0 -34
- package/lib/sfml.d.ts +0 -32
- package/lib/sfml.js +0 -36
- package/lib/sound/base.d.ts +0 -33
- package/lib/sound/base.js +0 -109
- package/lib/sound/music.d.ts +0 -15
- package/lib/sound/music.js +0 -65
- package/lib/sound/sound.d.ts +0 -16
- package/lib/sound/sound.js +0 -55
- package/lib/sound/sound_buffer.d.ts +0 -14
- package/lib/sound/sound_buffer.js +0 -78
- package/lib/texture.d.ts +0 -21
- package/lib/texture.js +0 -127
- package/lib/time.d.ts +0 -13
- package/lib/time.js +0 -41
- package/lib/touch.d.ts +0 -7
- package/lib/touch.js +0 -34
- package/lib/vector2.d.ts +0 -49
- package/lib/vector2.js +0 -141
- package/lib/vector3.d.ts +0 -47
- package/lib/vector3.js +0 -154
- package/lib/vertex.d.ts +0 -14
- package/lib/vertex.js +0 -177
- package/lib/video_mode.d.ts +0 -12
- package/lib/video_mode.js +0 -99
- package/src/base_class_with_loading.h +0 -21
- package/src/clock.cc +0 -71
- package/src/clock.h +0 -30
- package/src/color.cc +0 -189
- package/src/color.h +0 -49
- package/src/drawable/circle_shape.cc +0 -78
- package/src/drawable/circle_shape.h +0 -28
- package/src/drawable/convex_shape.cc +0 -57
- package/src/drawable/convex_shape.h +0 -29
- package/src/drawable/drawable-inl.h +0 -29
- package/src/drawable/drawable.cc +0 -41
- package/src/drawable/drawable.h +0 -49
- package/src/drawable/package_plugin-inl.h +0 -191
- package/src/drawable/package_plugin.h +0 -60
- package/src/drawable/rectangle_shape.cc +0 -69
- package/src/drawable/rectangle_shape.h +0 -29
- package/src/drawable/shape.cc +0 -67
- package/src/drawable/shape.h +0 -39
- package/src/drawable/sprite.cc +0 -122
- package/src/drawable/sprite.h +0 -45
- package/src/drawable/text.cc +0 -133
- package/src/drawable/text.h +0 -54
- package/src/drawable/vertex_array.cc +0 -248
- package/src/drawable/vertex_array.h +0 -46
- package/src/font.cc +0 -214
- package/src/font.h +0 -44
- package/src/gen/.gitkeep +0 -0
- package/src/gen/joystick_axis.cc +0 -30
- package/src/gen/keycode.cc +0 -226
- package/src/gen/mouse_button.cc +0 -30
- package/src/gen/sensor_type.cc +0 -26
- package/src/image.cc +0 -379
- package/src/image.h +0 -72
- package/src/joystick.cc +0 -132
- package/src/joystick.h +0 -32
- package/src/keyboard.cc +0 -65
- package/src/keyboard.h +0 -27
- package/src/mouse.cc +0 -95
- package/src/mouse.h +0 -30
- package/src/plugins/transformable_plugin-inl.h +0 -121
- package/src/plugins/transformable_plugin.h +0 -42
- package/src/poll_event.cc +0 -326
- package/src/poll_event.h +0 -18
- package/src/rect-inl.h +0 -154
- package/src/rect.cc +0 -28
- package/src/rect.h +0 -105
- package/src/render_window.cc +0 -413
- package/src/render_window.h +0 -111
- package/src/render_window_async_display.cc +0 -49
- package/src/render_window_async_draw.cc +0 -56
- package/src/resizable_buffer.h +0 -104
- package/src/sensor.cc +0 -82
- package/src/sensor.h +0 -28
- package/src/sfml.cc +0 -85
- package/src/sound/music.cc +0 -113
- package/src/sound/music.h +0 -35
- package/src/sound/sound.cc +0 -116
- package/src/sound/sound.h +0 -41
- package/src/sound/sound_buffer.cc +0 -226
- package/src/sound/sound_buffer.h +0 -46
- package/src/sound/sound_source.cc +0 -124
- package/src/sound/sound_source.h +0 -80
- package/src/texture.cc +0 -246
- package/src/texture.h +0 -47
- package/src/time.cc +0 -177
- package/src/time.h +0 -42
- package/src/touch.cc +0 -54
- package/src/touch.h +0 -23
- package/src/utils-inl.h +0 -48
- package/src/utils.h +0 -21
- package/src/vector2-inl.h +0 -198
- package/src/vector2.cc +0 -36
- package/src/vector2.h +0 -133
- package/src/vector3-inl.h +0 -200
- package/src/vector3.cc +0 -36
- package/src/vector3.h +0 -134
- package/src/vertex.cc +0 -238
- package/src/vertex.h +0 -114
- package/src/video_mode.cc +0 -184
- package/src/video_mode.h +0 -38
- package/src/workers/load_from_file_worker.h +0 -79
- package/src/workers/save_to_file_worker.h +0 -79
- package/third_party/sfml/include/SFML/Audio/AlResource.hpp +0 -70
- package/third_party/sfml/include/SFML/Audio/Export.hpp +0 -48
- package/third_party/sfml/include/SFML/Audio/InputSoundFile.hpp +0 -268
- package/third_party/sfml/include/SFML/Audio/Listener.hpp +0 -234
- package/third_party/sfml/include/SFML/Audio/Music.hpp +0 -337
- package/third_party/sfml/include/SFML/Audio/OutputSoundFile.hpp +0 -133
- package/third_party/sfml/include/SFML/Audio/Sound.hpp +0 -264
- package/third_party/sfml/include/SFML/Audio/SoundBuffer.hpp +0 -352
- package/third_party/sfml/include/SFML/Audio/SoundBufferRecorder.hpp +0 -144
- package/third_party/sfml/include/SFML/Audio/SoundFileFactory.hpp +0 -197
- package/third_party/sfml/include/SFML/Audio/SoundFileFactory.inl +0 -100
- package/third_party/sfml/include/SFML/Audio/SoundFileReader.hpp +0 -165
- package/third_party/sfml/include/SFML/Audio/SoundFileWriter.hpp +0 -125
- package/third_party/sfml/include/SFML/Audio/SoundRecorder.hpp +0 -410
- package/third_party/sfml/include/SFML/Audio/SoundSource.hpp +0 -332
- package/third_party/sfml/include/SFML/Audio/SoundStream.hpp +0 -420
- package/third_party/sfml/include/SFML/Audio.hpp +0 -56
- package/third_party/sfml/include/SFML/Config.hpp +0 -248
- package/third_party/sfml/include/SFML/GpuPreference.hpp +0 -74
- package/third_party/sfml/include/SFML/Graphics/BlendMode.hpp +0 -219
- package/third_party/sfml/include/SFML/Graphics/CircleShape.hpp +0 -154
- package/third_party/sfml/include/SFML/Graphics/Color.hpp +0 -275
- package/third_party/sfml/include/SFML/Graphics/ConvexShape.hpp +0 -153
- package/third_party/sfml/include/SFML/Graphics/Drawable.hpp +0 -126
- package/third_party/sfml/include/SFML/Graphics/Export.hpp +0 -48
- package/third_party/sfml/include/SFML/Graphics/Font.hpp +0 -496
- package/third_party/sfml/include/SFML/Graphics/Glsl.hpp +0 -227
- package/third_party/sfml/include/SFML/Graphics/Glsl.inl +0 -155
- package/third_party/sfml/include/SFML/Graphics/Glyph.hpp +0 -81
- package/third_party/sfml/include/SFML/Graphics/Image.hpp +0 -346
- package/third_party/sfml/include/SFML/Graphics/PrimitiveType.hpp +0 -58
- package/third_party/sfml/include/SFML/Graphics/Rect.hpp +0 -274
- package/third_party/sfml/include/SFML/Graphics/Rect.inl +0 -171
- package/third_party/sfml/include/SFML/Graphics/RectangleShape.hpp +0 -132
- package/third_party/sfml/include/SFML/Graphics/RenderStates.hpp +0 -174
- package/third_party/sfml/include/SFML/Graphics/RenderTarget.hpp +0 -518
- package/third_party/sfml/include/SFML/Graphics/RenderTexture.hpp +0 -334
- package/third_party/sfml/include/SFML/Graphics/RenderWindow.hpp +0 -302
- package/third_party/sfml/include/SFML/Graphics/Shader.hpp +0 -875
- package/third_party/sfml/include/SFML/Graphics/Shape.hpp +0 -355
- package/third_party/sfml/include/SFML/Graphics/Sprite.hpp +0 -279
- package/third_party/sfml/include/SFML/Graphics/Text.hpp +0 -513
- package/third_party/sfml/include/SFML/Graphics/Texture.hpp +0 -733
- package/third_party/sfml/include/SFML/Graphics/Transform.hpp +0 -497
- package/third_party/sfml/include/SFML/Graphics/Transformable.hpp +0 -429
- package/third_party/sfml/include/SFML/Graphics/Vertex.hpp +0 -148
- package/third_party/sfml/include/SFML/Graphics/VertexArray.hpp +0 -223
- package/third_party/sfml/include/SFML/Graphics/VertexBuffer.hpp +0 -408
- package/third_party/sfml/include/SFML/Graphics/View.hpp +0 -343
- package/third_party/sfml/include/SFML/Graphics.hpp +0 -68
- package/third_party/sfml/include/SFML/Main.hpp +0 -43
- package/third_party/sfml/include/SFML/Network/Export.hpp +0 -48
- package/third_party/sfml/include/SFML/Network/Ftp.hpp +0 -616
- package/third_party/sfml/include/SFML/Network/Http.hpp +0 -482
- package/third_party/sfml/include/SFML/Network/IpAddress.hpp +0 -328
- package/third_party/sfml/include/SFML/Network/Packet.hpp +0 -545
- package/third_party/sfml/include/SFML/Network/Socket.hpp +0 -219
- package/third_party/sfml/include/SFML/Network/SocketHandle.hpp +0 -57
- package/third_party/sfml/include/SFML/Network/SocketSelector.hpp +0 -263
- package/third_party/sfml/include/SFML/Network/TcpListener.hpp +0 -170
- package/third_party/sfml/include/SFML/Network/TcpSocket.hpp +0 -316
- package/third_party/sfml/include/SFML/Network/UdpSocket.hpp +0 -292
- package/third_party/sfml/include/SFML/Network.hpp +0 -53
- package/third_party/sfml/include/SFML/OpenGL.hpp +0 -78
- package/third_party/sfml/include/SFML/System/Clock.hpp +0 -117
- package/third_party/sfml/include/SFML/System/Err.hpp +0 -80
- package/third_party/sfml/include/SFML/System/Export.hpp +0 -48
- package/third_party/sfml/include/SFML/System/FileInputStream.hpp +0 -169
- package/third_party/sfml/include/SFML/System/InputStream.hpp +0 -152
- package/third_party/sfml/include/SFML/System/Lock.hpp +0 -139
- package/third_party/sfml/include/SFML/System/MemoryInputStream.hpp +0 -148
- package/third_party/sfml/include/SFML/System/Mutex.hpp +0 -148
- package/third_party/sfml/include/SFML/System/NativeActivity.hpp +0 -62
- package/third_party/sfml/include/SFML/System/NonCopyable.hpp +0 -129
- package/third_party/sfml/include/SFML/System/Sleep.hpp +0 -52
- package/third_party/sfml/include/SFML/System/String.hpp +0 -669
- package/third_party/sfml/include/SFML/System/String.inl +0 -53
- package/third_party/sfml/include/SFML/System/Thread.hpp +0 -282
- package/third_party/sfml/include/SFML/System/Thread.inl +0 -90
- package/third_party/sfml/include/SFML/System/ThreadLocal.hpp +0 -103
- package/third_party/sfml/include/SFML/System/ThreadLocalPtr.hpp +0 -158
- package/third_party/sfml/include/SFML/System/ThreadLocalPtr.inl +0 -77
- package/third_party/sfml/include/SFML/System/Time.hpp +0 -488
- package/third_party/sfml/include/SFML/System/Utf.hpp +0 -763
- package/third_party/sfml/include/SFML/System/Utf.inl +0 -752
- package/third_party/sfml/include/SFML/System/Vector2.hpp +0 -301
- package/third_party/sfml/include/SFML/System/Vector2.inl +0 -161
- package/third_party/sfml/include/SFML/System/Vector3.hpp +0 -302
- package/third_party/sfml/include/SFML/System/Vector3.inl +0 -168
- package/third_party/sfml/include/SFML/System.hpp +0 -60
- package/third_party/sfml/include/SFML/Window/Clipboard.hpp +0 -119
- package/third_party/sfml/include/SFML/Window/Context.hpp +0 -195
- package/third_party/sfml/include/SFML/Window/ContextSettings.hpp +0 -149
- package/third_party/sfml/include/SFML/Window/Cursor.hpp +0 -241
- package/third_party/sfml/include/SFML/Window/Event.hpp +0 -285
- package/third_party/sfml/include/SFML/Window/Export.hpp +0 -48
- package/third_party/sfml/include/SFML/Window/GlResource.hpp +0 -109
- package/third_party/sfml/include/SFML/Window/Joystick.hpp +0 -227
- package/third_party/sfml/include/SFML/Window/Keyboard.hpp +0 -491
- package/third_party/sfml/include/SFML/Window/Mouse.hpp +0 -180
- package/third_party/sfml/include/SFML/Window/Sensor.hpp +0 -150
- package/third_party/sfml/include/SFML/Window/Touch.hpp +0 -137
- package/third_party/sfml/include/SFML/Window/VideoMode.hpp +0 -228
- package/third_party/sfml/include/SFML/Window/Vulkan.hpp +0 -115
- package/third_party/sfml/include/SFML/Window/Window.hpp +0 -354
- package/third_party/sfml/include/SFML/Window/WindowBase.hpp +0 -518
- package/third_party/sfml/include/SFML/Window/WindowHandle.hpp +0 -101
- package/third_party/sfml/include/SFML/Window/WindowStyle.hpp +0 -53
- package/third_party/sfml/include/SFML/Window.hpp +0 -58
- package/tools/clang_format.js +0 -9
- package/tools/copier/linux.js +0 -21
- package/tools/copier/macos.js +0 -34
- package/tools/copier/windows.js +0 -33
- package/tools/joystick_axis.js +0 -63
- package/tools/keycode.js +0 -92
- package/tools/lib_downloader.js +0 -107
- package/tools/lib_downloader_urls.js +0 -59
- package/tools/mouse_button.js +0 -92
- package/tools/sensor_type.js +0 -63
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
import {
|
|
2
|
+
native, type NativeGraphicsHandle,
|
|
3
|
+
type NativeGlyphProcessor,
|
|
4
|
+
} from '../internal/native';
|
|
5
|
+
import {
|
|
6
|
+
dispatchDrawable, flushGraphics, graphicsNative, recordVertices, vertexArrayBytes,
|
|
7
|
+
} from '../internal/graphics-state';
|
|
8
|
+
import {
|
|
9
|
+
withTransformable, transformableState, type TransformableState,
|
|
10
|
+
} from '../internal/transformable';
|
|
11
|
+
import { mutableValue, type ReadonlyValue as R } from '../internal/value-storage';
|
|
12
|
+
import { ShapedGlyphBuffer, ShapedGlyphView } from '../internal/shaped-glyph';
|
|
13
|
+
import { TextIndices } from '../internal/text-indices';
|
|
14
|
+
import { Vector2f } from '../system/vector2';
|
|
15
|
+
import { SFMLError } from '../system/error';
|
|
16
|
+
import { Color } from './color';
|
|
17
|
+
import { Drawable } from './drawable';
|
|
18
|
+
import { Font, fontRevision, fontUnsigned, textFloat, type ReadonlyFont } from './font';
|
|
19
|
+
import type { Glyph } from './glyph';
|
|
20
|
+
import { FloatRect } from './rect';
|
|
21
|
+
import { RenderStates, CoordinateType } from './render-states';
|
|
22
|
+
import type { RenderTarget } from './render-target';
|
|
23
|
+
import { vertexArrayFromMapping, VertexArray } from './vertex-array';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Text style bit flags, combinable with bitwise operations.
|
|
27
|
+
* @zh 文本样式位标志,可按位组合。
|
|
28
|
+
* @ja ビット演算で組み合わせ可能なテキストスタイルフラグ。
|
|
29
|
+
* @ko 비트 연산으로 조합할 수 있는 텍스트 스타일 플래그입니다.
|
|
30
|
+
*/
|
|
31
|
+
export enum TextStyle {
|
|
32
|
+
/**
|
|
33
|
+
* Regular.
|
|
34
|
+
* @zh 常规。
|
|
35
|
+
* @ja 標準。
|
|
36
|
+
* @ko 일반입니다.
|
|
37
|
+
*/
|
|
38
|
+
Regular = 0,
|
|
39
|
+
/**
|
|
40
|
+
* Bold.
|
|
41
|
+
* @zh 粗体。
|
|
42
|
+
* @ja 太字。
|
|
43
|
+
* @ko 굵게입니다.
|
|
44
|
+
*/
|
|
45
|
+
Bold = 1,
|
|
46
|
+
/**
|
|
47
|
+
* Italic.
|
|
48
|
+
* @zh 斜体。
|
|
49
|
+
* @ja 斜体。
|
|
50
|
+
* @ko 기울임꼴입니다.
|
|
51
|
+
*/
|
|
52
|
+
Italic = 2,
|
|
53
|
+
/**
|
|
54
|
+
* Underlined.
|
|
55
|
+
* @zh 下划线。
|
|
56
|
+
* @ja 下線。
|
|
57
|
+
* @ko 밑줄입니다.
|
|
58
|
+
*/
|
|
59
|
+
Underlined = 4,
|
|
60
|
+
/**
|
|
61
|
+
* Strikethrough.
|
|
62
|
+
* @zh 删除线。
|
|
63
|
+
* @ja 取り消し線。
|
|
64
|
+
* @ko 취소선입니다.
|
|
65
|
+
*/
|
|
66
|
+
StrikeThrough = 8,
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Text line alignment.
|
|
70
|
+
* @zh 文本行对齐方式。
|
|
71
|
+
* @ja テキスト行の配置。
|
|
72
|
+
* @ko 텍스트 행 정렬입니다.
|
|
73
|
+
*/
|
|
74
|
+
export enum LineAlignment {
|
|
75
|
+
/**
|
|
76
|
+
* Chooses default alignment based on text direction.
|
|
77
|
+
* @zh 根据文字方向选择默认对齐。
|
|
78
|
+
* @ja テキストの方向に応じて既定の配置を選びます。
|
|
79
|
+
* @ko 텍스트 방향에 따라 기본 정렬을 선택합니다.
|
|
80
|
+
*/
|
|
81
|
+
Default,
|
|
82
|
+
/**
|
|
83
|
+
* Left-aligned.
|
|
84
|
+
* @zh 左对齐。
|
|
85
|
+
* @ja 左揃え。
|
|
86
|
+
* @ko 왼쪽 정렬입니다.
|
|
87
|
+
*/
|
|
88
|
+
Left,
|
|
89
|
+
/**
|
|
90
|
+
* Centered.
|
|
91
|
+
* @zh 居中。
|
|
92
|
+
* @ja 中央揃え。
|
|
93
|
+
* @ko 가운데 정렬입니다.
|
|
94
|
+
*/
|
|
95
|
+
Center,
|
|
96
|
+
/**
|
|
97
|
+
* Right-aligned.
|
|
98
|
+
* @zh 右对齐。
|
|
99
|
+
* @ja 右揃え。
|
|
100
|
+
* @ko 오른쪽 정렬입니다.
|
|
101
|
+
*/
|
|
102
|
+
Right,
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Glyph cluster grouping for text shaping.
|
|
106
|
+
* @zh 文本整形时的字形簇分组方式。
|
|
107
|
+
* @ja テキストシェーピング時のグリフクラスターのグループ化方法。
|
|
108
|
+
* @ko 텍스트 셰이핑 시 글리프 클러스터 그룹화 방식입니다.
|
|
109
|
+
*/
|
|
110
|
+
export enum ClusterGrouping {
|
|
111
|
+
/**
|
|
112
|
+
* Groups by user-perceived graphemes.
|
|
113
|
+
* @zh 按用户感知的字素分组。
|
|
114
|
+
* @ja ユーザーが認識する書記素単位でグループ化します。
|
|
115
|
+
* @ko 사용자가 인식하는 자소 단위로 그룹화합니다.
|
|
116
|
+
*/
|
|
117
|
+
Grapheme,
|
|
118
|
+
/**
|
|
119
|
+
* Groups by Unicode characters.
|
|
120
|
+
* @zh 按 Unicode 字符分组。
|
|
121
|
+
* @ja Unicode 文字単位でグループ化します。
|
|
122
|
+
* @ko Unicode 문자 단위로 그룹화합니다.
|
|
123
|
+
*/
|
|
124
|
+
Character,
|
|
125
|
+
/**
|
|
126
|
+
* Does not merge glyph clusters.
|
|
127
|
+
* @zh 不合并字形簇。
|
|
128
|
+
* @ja グリフクラスターを結合しません。
|
|
129
|
+
* @ko 글리프 클러스터를 병합하지 않습니다.
|
|
130
|
+
*/
|
|
131
|
+
None,
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Glyph layout direction.
|
|
135
|
+
* @zh 字形排布方向。
|
|
136
|
+
* @ja グリフの配置方向。
|
|
137
|
+
* @ko 글리프 배치 방향입니다.
|
|
138
|
+
*/
|
|
139
|
+
export enum TextDirection {
|
|
140
|
+
/**
|
|
141
|
+
* Unspecified direction.
|
|
142
|
+
* @zh 未指定方向。
|
|
143
|
+
* @ja 方向未指定。
|
|
144
|
+
* @ko 방향 미지정입니다.
|
|
145
|
+
*/
|
|
146
|
+
Unspecified,
|
|
147
|
+
/**
|
|
148
|
+
* Left to right.
|
|
149
|
+
* @zh 从左到右。
|
|
150
|
+
* @ja 左から右。
|
|
151
|
+
* @ko 왼쪽에서 오른쪽입니다.
|
|
152
|
+
*/
|
|
153
|
+
LeftToRight,
|
|
154
|
+
/**
|
|
155
|
+
* Right to left.
|
|
156
|
+
* @zh 从右到左。
|
|
157
|
+
* @ja 右から左。
|
|
158
|
+
* @ko 오른쪽에서 왼쪽입니다.
|
|
159
|
+
*/
|
|
160
|
+
RightToLeft,
|
|
161
|
+
/**
|
|
162
|
+
* Top to bottom.
|
|
163
|
+
* @zh 从上到下。
|
|
164
|
+
* @ja 上から下。
|
|
165
|
+
* @ko 위에서 아래입니다.
|
|
166
|
+
*/
|
|
167
|
+
TopToBottom,
|
|
168
|
+
/**
|
|
169
|
+
* Bottom to top.
|
|
170
|
+
* @zh 从下到上。
|
|
171
|
+
* @ja 下から上。
|
|
172
|
+
* @ko 아래에서 위입니다.
|
|
173
|
+
*/
|
|
174
|
+
BottomToTop,
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Horizontal or vertical writing direction.
|
|
178
|
+
* @zh 横排或竖排方向。
|
|
179
|
+
* @ja 横書きまたは縦書きの方向。
|
|
180
|
+
* @ko 가로쓰기 또는 세로쓰기 방향입니다.
|
|
181
|
+
*/
|
|
182
|
+
export enum TextOrientation {
|
|
183
|
+
/**
|
|
184
|
+
* Default horizontal writing.
|
|
185
|
+
* @zh 默认横排。
|
|
186
|
+
* @ja 既定の横書き。
|
|
187
|
+
* @ko 기본 가로쓰기입니다.
|
|
188
|
+
*/
|
|
189
|
+
Default,
|
|
190
|
+
/**
|
|
191
|
+
* Vertical writing from top to bottom.
|
|
192
|
+
* @zh 从上到下竖排。
|
|
193
|
+
* @ja 上から下への縦書き。
|
|
194
|
+
* @ko 위에서 아래로 세로쓰기입니다.
|
|
195
|
+
*/
|
|
196
|
+
TopToBottom,
|
|
197
|
+
/**
|
|
198
|
+
* Vertical writing from bottom to top.
|
|
199
|
+
* @zh 从下到上竖排。
|
|
200
|
+
* @ja 下から上への縦書き。
|
|
201
|
+
* @ko 아래에서 위로 세로쓰기입니다.
|
|
202
|
+
*/
|
|
203
|
+
BottomToTop,
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A single shaped glyph and its layout information.
|
|
208
|
+
* @zh 整形后的单个字形及其布局信息。
|
|
209
|
+
* @ja シェーピング済みの単一グリフとその配置情報。
|
|
210
|
+
* @ko 셰이핑된 단일 글리프와 배치 정보입니다.
|
|
211
|
+
*/
|
|
212
|
+
export interface ShapedGlyph {
|
|
213
|
+
/**
|
|
214
|
+
* Read-only view of font glyph metrics.
|
|
215
|
+
* @zh 字体字形度量的只读视图。
|
|
216
|
+
* @ja フォントグリフメトリクスの読み取り専用ビュー。
|
|
217
|
+
* @ko 글꼴 글리프 메트릭의 읽기 전용 뷰입니다.
|
|
218
|
+
*/
|
|
219
|
+
readonly glyph: R<Glyph>;
|
|
220
|
+
/**
|
|
221
|
+
* Glyph position in text-local coordinates.
|
|
222
|
+
* @zh 字形在文本局部坐标中的位置。
|
|
223
|
+
* @ja テキストのローカル座標でのグリフ位置。
|
|
224
|
+
* @ko 텍스트 로컬 좌표계의 글리프 위치입니다.
|
|
225
|
+
*/
|
|
226
|
+
readonly position: R<Vector2f>;
|
|
227
|
+
/**
|
|
228
|
+
* UTF-16 index into getString(), suitable for JS slice/substring.
|
|
229
|
+
* @zh getString() 中的 UTF-16 索引,适用于 JS slice/substring。
|
|
230
|
+
* @ja getString() 内の UTF-16 インデックス。JS の slice/substring に適しています。
|
|
231
|
+
* @ko getString()의 UTF-16 인덱스이며 JS slice/substring에 사용할 수 있습니다.
|
|
232
|
+
*/
|
|
233
|
+
readonly cluster: number;
|
|
234
|
+
/**
|
|
235
|
+
* Direction of the text segment containing the glyph.
|
|
236
|
+
* @zh 字形所处文本段的方向。
|
|
237
|
+
* @ja グリフを含むテキスト区間の方向。
|
|
238
|
+
* @ko 글리프가 속한 텍스트 구간의 방향입니다.
|
|
239
|
+
*/
|
|
240
|
+
readonly textDirection: TextDirection;
|
|
241
|
+
/**
|
|
242
|
+
* Baseline coordinate of the line containing the glyph.
|
|
243
|
+
* @zh 字形所在行的基线坐标。
|
|
244
|
+
* @ja グリフが属する行のベースライン座標。
|
|
245
|
+
* @ko 글리프가 속한 행의 기준선 좌표입니다.
|
|
246
|
+
*/
|
|
247
|
+
readonly baseline: number;
|
|
248
|
+
/**
|
|
249
|
+
* Index of the glyph's first vertex in the vertex data.
|
|
250
|
+
* @zh 字形在顶点数据中的起始顶点索引。
|
|
251
|
+
* @ja 頂点データ内のグリフの開始頂点インデックス。
|
|
252
|
+
* @ko 꼭짓점 데이터에서 글리프의 시작 꼭짓점 인덱스입니다.
|
|
253
|
+
*/
|
|
254
|
+
readonly vertexOffset: number;
|
|
255
|
+
/**
|
|
256
|
+
* Number of vertices occupied by the glyph.
|
|
257
|
+
* @zh 字形占用的顶点数。
|
|
258
|
+
* @ja グリフが占める頂点数。
|
|
259
|
+
* @ko 글리프가 차지하는 꼭짓점 수입니다.
|
|
260
|
+
*/
|
|
261
|
+
readonly vertexCount: number;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Single-glyph appearance editable by the glyph preprocessor.
|
|
266
|
+
* @zh 字形预处理器可修改的单字形外观。
|
|
267
|
+
* @ja グリフプリプロセッサーが変更できる単一グリフの外観。
|
|
268
|
+
* @ko 글리프 전처리기가 수정할 수 있는 단일 글리프 외형입니다.
|
|
269
|
+
*/
|
|
270
|
+
export interface GlyphAppearance {
|
|
271
|
+
/**
|
|
272
|
+
* Glyph style bit flags.
|
|
273
|
+
* @zh 字形样式位标志。
|
|
274
|
+
* @ja グリフスタイルのビットフラグ。
|
|
275
|
+
* @ko 글리프 스타일 비트 플래그입니다.
|
|
276
|
+
*/
|
|
277
|
+
style: TextStyle;
|
|
278
|
+
/**
|
|
279
|
+
* Mutable fill color.
|
|
280
|
+
* @zh 可修改的填充颜色。
|
|
281
|
+
* @ja 変更可能な塗りつぶし色。
|
|
282
|
+
* @ko 수정 가능한 채우기 색상입니다.
|
|
283
|
+
*/
|
|
284
|
+
get fillColor(): Color;
|
|
285
|
+
/**
|
|
286
|
+
* Copies the fill color.
|
|
287
|
+
* @zh 复制填充颜色。
|
|
288
|
+
* @ja 塗りつぶし色をコピーします。
|
|
289
|
+
* @ko 채우기 색상을 복사합니다.
|
|
290
|
+
*/
|
|
291
|
+
set fillColor(value: R<Color>);
|
|
292
|
+
/**
|
|
293
|
+
* Mutable outline color.
|
|
294
|
+
* @zh 可修改的轮廓颜色。
|
|
295
|
+
* @ja 変更可能な輪郭色。
|
|
296
|
+
* @ko 수정 가능한 윤곽선 색상입니다.
|
|
297
|
+
*/
|
|
298
|
+
get outlineColor(): Color;
|
|
299
|
+
/**
|
|
300
|
+
* Copies the outline color.
|
|
301
|
+
* @zh 复制轮廓颜色。
|
|
302
|
+
* @ja 輪郭色をコピーします。
|
|
303
|
+
* @ko 윤곽선 색상을 복사합니다.
|
|
304
|
+
*/
|
|
305
|
+
set outlineColor(value: R<Color>);
|
|
306
|
+
/**
|
|
307
|
+
* Outline thickness in pixels.
|
|
308
|
+
* @zh 轮廓厚度,单位为像素。
|
|
309
|
+
* @ja ピクセル単位の輪郭の太さ。
|
|
310
|
+
* @ko 픽셀 단위 윤곽선 두께입니다.
|
|
311
|
+
*/
|
|
312
|
+
outlineThickness: number;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Callback that synchronously changes glyph appearance; must not modify or
|
|
316
|
+
* query geometry of the same Text while running.
|
|
317
|
+
* @zh 同步修改字形外观的回调;执行期间不得修改或查询同一 Text 的几何。
|
|
318
|
+
* @ja グリフの外観を同期的に変更するコールバック。実行中は同じ Text のジオメトリを変更または照会してはいけません。
|
|
319
|
+
* @ko 글리프 외형을 동기적으로 수정하는 콜백입니다. 실행 중에는 동일한 Text의 기하 구조를 수정하거나 조회하면 안 됩니다.
|
|
320
|
+
*/
|
|
321
|
+
export type GlyphPreProcessor = (glyph: ShapedGlyph, appearance: GlyphAppearance) => void;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Initial text parameters.
|
|
325
|
+
* @zh 文本初始参数。
|
|
326
|
+
* @ja テキストの初期パラメーター。
|
|
327
|
+
* @ko 텍스트 초기 매개변수입니다.
|
|
328
|
+
*/
|
|
329
|
+
export interface TextOptions {
|
|
330
|
+
/**
|
|
331
|
+
* Font resource whose reference is retained by Text.
|
|
332
|
+
* @zh 字体资源,Text 会保留其引用。
|
|
333
|
+
* @ja Text が参照を保持するフォントリソース。
|
|
334
|
+
* @ko Text가 참조를 유지하는 글꼴 리소스입니다.
|
|
335
|
+
*/
|
|
336
|
+
font: ReadonlyFont;
|
|
337
|
+
/**
|
|
338
|
+
* Initial string; defaults to empty.
|
|
339
|
+
* @zh 初始字符串,默认空串。
|
|
340
|
+
* @ja 初期文字列。既定は空文字列。
|
|
341
|
+
* @ko 초기 문자열입니다. 기본값은 빈 문자열입니다.
|
|
342
|
+
*/
|
|
343
|
+
string?: string;
|
|
344
|
+
/**
|
|
345
|
+
* Character size in pixels; defaults to 30.
|
|
346
|
+
* @zh 像素字号,默认 30。
|
|
347
|
+
* @ja ピクセル単位の文字サイズ。既定値は 30。
|
|
348
|
+
* @ko 픽셀 단위 글자 크기입니다. 기본값은 30입니다.
|
|
349
|
+
*/
|
|
350
|
+
characterSize?: number;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function colorInteger(value: R<Color>): number {
|
|
354
|
+
if (!(value instanceof Color)) throw new TypeError('Expected a Color');
|
|
355
|
+
return value.toInteger();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
class TextResource extends Drawable {
|
|
359
|
+
readonly [mutableValue] = true;
|
|
360
|
+
readonly [graphicsNative]: NativeGraphicsHandle<'text'>;
|
|
361
|
+
readonly [transformableState]: TransformableState;
|
|
362
|
+
/**
|
|
363
|
+
* Current font reference.
|
|
364
|
+
* @zh 当前字体引用。
|
|
365
|
+
* @ja 現在のフォント参照。
|
|
366
|
+
* @ko 현재 글꼴 참조입니다.
|
|
367
|
+
*/
|
|
368
|
+
private font: ReadonlyFont;
|
|
369
|
+
/**
|
|
370
|
+
* Current displayed string.
|
|
371
|
+
* @zh 当前显示字符串。
|
|
372
|
+
* @ja 現在表示する文字列。
|
|
373
|
+
* @ko 현재 표시되는 문자열입니다.
|
|
374
|
+
*/
|
|
375
|
+
private string = '';
|
|
376
|
+
/**
|
|
377
|
+
* Cached index mapping from the string to glyph ranges.
|
|
378
|
+
* @zh 字符串到字形范围的索引映射缓存。
|
|
379
|
+
* @ja 文字列からグリフ範囲へのインデックス対応キャッシュ。
|
|
380
|
+
* @ko 문자열에서 글리프 범위로의 인덱스 매핑 캐시입니다.
|
|
381
|
+
*/
|
|
382
|
+
private indices?: TextIndices;
|
|
383
|
+
/**
|
|
384
|
+
* Float32 view of the Native parameter field buffer.
|
|
385
|
+
* @zh Native 参数字段缓冲区的 Float32 视图。
|
|
386
|
+
* @ja Native パラメーターフィールドバッファーの Float32 ビュー。
|
|
387
|
+
* @ko Native 매개변수 필드 버퍼의 Float32 뷰입니다.
|
|
388
|
+
*/
|
|
389
|
+
private readonly floats: Float32Array;
|
|
390
|
+
/**
|
|
391
|
+
* Uint32 view of the Native parameter field buffer.
|
|
392
|
+
* @zh Native 参数字段缓冲区的 Uint32 视图。
|
|
393
|
+
* @ja Native パラメーターフィールドバッファーの Uint32 ビュー。
|
|
394
|
+
* @ko Native 매개변수 필드 버퍼의 Uint32 뷰입니다.
|
|
395
|
+
*/
|
|
396
|
+
private readonly words: Uint32Array;
|
|
397
|
+
/**
|
|
398
|
+
* DataView of the Native color field buffer.
|
|
399
|
+
* @zh Native 颜色字段缓冲区的 DataView。
|
|
400
|
+
* @ja Native 色フィールドバッファーの DataView。
|
|
401
|
+
* @ko Native 색상 필드 버퍼의 DataView입니다.
|
|
402
|
+
*/
|
|
403
|
+
private readonly colors: DataView;
|
|
404
|
+
/**
|
|
405
|
+
* Geometry dirty flags and vertical writing mode flags.
|
|
406
|
+
* @zh 几何脏标记及竖排模式标志。
|
|
407
|
+
* @ja ジオメトリの更新必要フラグと縦書きモードフラグ。
|
|
408
|
+
* @ko 기하 구조 변경 표시 및 세로쓰기 모드 플래그입니다.
|
|
409
|
+
*/
|
|
410
|
+
private readonly geometry: Uint8Array;
|
|
411
|
+
/**
|
|
412
|
+
* Shaped local bounds [x, y, w, h].
|
|
413
|
+
* @zh 整形后的局部包围框 [x, y, w, h]。
|
|
414
|
+
* @ja シェーピング後のローカル境界矩形 [x, y, w, h]。
|
|
415
|
+
* @ko 셰이핑 후 로컬 경계 상자 [x, y, w, h]입니다.
|
|
416
|
+
*/
|
|
417
|
+
private readonly bounds: Float32Array;
|
|
418
|
+
/**
|
|
419
|
+
* Optional synchronous glyph appearance callback.
|
|
420
|
+
* @zh 可选的同步字形外观回调。
|
|
421
|
+
* @ja 任意の同期グリフ外観コールバック。
|
|
422
|
+
* @ko 선택적인 동기 글리프 외형 콜백입니다.
|
|
423
|
+
*/
|
|
424
|
+
private processor: GlyphPreProcessor | null = null;
|
|
425
|
+
/**
|
|
426
|
+
* Boolean lock preventing recursion in preprocessor callbacks.
|
|
427
|
+
* @zh 防止在预处理器回调中递归的布尔锁。
|
|
428
|
+
* @ja プリプロセッサーコールバック内の再帰を防ぐブールロック。
|
|
429
|
+
* @ko 전처리기 콜백의 재귀를 방지하는 불리언 잠금입니다.
|
|
430
|
+
*/
|
|
431
|
+
private preparing = false;
|
|
432
|
+
/**
|
|
433
|
+
* fontRevision at the last shaping, used to skip reshaping when unchanged.
|
|
434
|
+
* @zh 上次整形时的 fontRevision,用于跳过未变更的重新整形。
|
|
435
|
+
* @ja 前回のシェーピング時の fontRevision。変更がない場合に再シェーピングを省略するために使います。
|
|
436
|
+
* @ko 마지막 셰이핑 시점의 fontRevision입니다. 변경이 없으면 다시 셰이핑하지 않는 데 사용합니다.
|
|
437
|
+
*/
|
|
438
|
+
private revision = -1;
|
|
439
|
+
/**
|
|
440
|
+
* Fill vertex array, updated when geometry is rebuilt.
|
|
441
|
+
* @zh 填充顶点数组,几何重建时更新。
|
|
442
|
+
* @ja ジオメトリ再構築時に更新される塗りつぶし頂点配列。
|
|
443
|
+
* @ko 기하 구조를 재구성할 때 갱신되는 채우기 꼭짓점 배열입니다.
|
|
444
|
+
*/
|
|
445
|
+
private vertices!: VertexArray;
|
|
446
|
+
/**
|
|
447
|
+
* Outline vertex array, updated when geometry is rebuilt.
|
|
448
|
+
* @zh 轮廓顶点数组,几何重建时更新。
|
|
449
|
+
* @ja ジオメトリ再構築時に更新される輪郭頂点配列。
|
|
450
|
+
* @ko 기하 구조를 재구성할 때 갱신되는 윤곽선 꼭짓점 배열입니다.
|
|
451
|
+
*/
|
|
452
|
+
private outline!: VertexArray;
|
|
453
|
+
/**
|
|
454
|
+
* Glyph layout cache from the most recent shaping.
|
|
455
|
+
* @zh 最近一次整形的字形布局缓存。
|
|
456
|
+
* @ja 直近のシェーピングによるグリフ配置キャッシュ。
|
|
457
|
+
* @ko 가장 최근 셰이핑의 글리프 배치 캐시입니다.
|
|
458
|
+
*/
|
|
459
|
+
private glyphs?: readonly ShapedGlyph[];
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Creates text from a font and text parameters, or copies text retaining font
|
|
463
|
+
* and preprocessor references.
|
|
464
|
+
* @zh 从字体和文本参数创建文本,或复制文本并保留字体及预处理器引用。
|
|
465
|
+
* @ja フォントとテキストパラメーターからテキストを作成するか、フォントとプリプロセッサー参照を保持してテキストをコピーします。
|
|
466
|
+
* @ko 글꼴과 텍스트 매개변수로 텍스트를 만들거나 글꼴 및 전처리기 참조를 유지하여 텍스트를 복사합니다.
|
|
467
|
+
*/
|
|
468
|
+
constructor(options: TextOptions | R<TextResource>) {
|
|
469
|
+
super();
|
|
470
|
+
if (options instanceof TextResource) {
|
|
471
|
+
options.checkIdle();
|
|
472
|
+
this.font = options.font;
|
|
473
|
+
this.string = options.string;
|
|
474
|
+
this.indices = options.indices;
|
|
475
|
+
this.processor = options.processor;
|
|
476
|
+
} else {
|
|
477
|
+
const init = options as TextOptions;
|
|
478
|
+
if (!init || !(init.font instanceof Font)) throw new TypeError('Expected Text options with a Font');
|
|
479
|
+
this.font = init.font;
|
|
480
|
+
}
|
|
481
|
+
const mapping = native.createText(this.font[graphicsNative],
|
|
482
|
+
options instanceof TextResource ? options[graphicsNative] : undefined);
|
|
483
|
+
this[graphicsNative] = mapping.handle;
|
|
484
|
+
this.floats = new Float32Array(mapping.buffer);
|
|
485
|
+
this.words = new Uint32Array(mapping.buffer);
|
|
486
|
+
this.colors = new DataView(mapping.buffer);
|
|
487
|
+
this.geometry = new Uint8Array(mapping.geometry);
|
|
488
|
+
this.bounds = new Float32Array(mapping.bounds);
|
|
489
|
+
this[transformableState] = {
|
|
490
|
+
handle: mapping.transformable, values: new Float32Array(mapping.transform),
|
|
491
|
+
};
|
|
492
|
+
if (options instanceof TextResource) {
|
|
493
|
+
if (!this.geometry[0] && options.revision === this.font[fontRevision]) {
|
|
494
|
+
this.vertices = new VertexArray(options.vertices);
|
|
495
|
+
this.outline = new VertexArray(options.outline);
|
|
496
|
+
this.revision = options.revision;
|
|
497
|
+
}
|
|
498
|
+
} else {
|
|
499
|
+
const init = options as TextOptions;
|
|
500
|
+
if (init.string !== undefined) this.setString(init.string);
|
|
501
|
+
if (init.characterSize !== undefined) this.setCharacterSize(init.characterSize);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Sets the displayed string, reshaping on the next query or draw.
|
|
507
|
+
* @zh 设置显示字符串,下次查询或绘制时重新整形。
|
|
508
|
+
* @ja 表示文字列を設定し、次回の照会または描画で再シェーピングします。
|
|
509
|
+
* @ko 표시할 문자열을 설정하며 다음 조회 또는 그리기에서 다시 셰이핑합니다.
|
|
510
|
+
*/
|
|
511
|
+
setString(this: TextResource, value: string): void {
|
|
512
|
+
this.checkIdle();
|
|
513
|
+
if (typeof value !== 'string') throw new TypeError('Expected a string');
|
|
514
|
+
if (value !== this.string) {
|
|
515
|
+
this.string = value;
|
|
516
|
+
this.indices = undefined;
|
|
517
|
+
this.geometry[0] = 1;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Returns the current JS string.
|
|
522
|
+
* @zh 返回当前 JS 字符串。
|
|
523
|
+
* @ja 現在の JS 文字列を返します。
|
|
524
|
+
* @ko 현재 JS 문자열을 반환합니다.
|
|
525
|
+
*/
|
|
526
|
+
getString(): string { return this.string; }
|
|
527
|
+
/**
|
|
528
|
+
* Sets the font and retains its reference.
|
|
529
|
+
* @zh 设置字体并保留其引用。
|
|
530
|
+
* @ja フォントを設定し、その参照を保持します。
|
|
531
|
+
* @ko 글꼴을 설정하고 참조를 유지합니다.
|
|
532
|
+
*/
|
|
533
|
+
setFont(this: TextResource, font: ReadonlyFont): void {
|
|
534
|
+
this.checkIdle();
|
|
535
|
+
if (!(font instanceof Font)) throw new TypeError('Expected a Font');
|
|
536
|
+
if (font !== this.font) { this.font = font; this.geometry[0] = 1; }
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Returns a read-only reference to the current font.
|
|
540
|
+
* @zh 返回当前字体的只读引用。
|
|
541
|
+
* @ja 現在のフォントへの読み取り専用参照を返します。
|
|
542
|
+
* @ko 현재 글꼴의 읽기 전용 참조를 반환합니다.
|
|
543
|
+
*/
|
|
544
|
+
getFont(): ReadonlyFont { return this.font; }
|
|
545
|
+
/**
|
|
546
|
+
* Sets the character size in pixels.
|
|
547
|
+
* @zh 设置像素字号。
|
|
548
|
+
* @ja 文字サイズをピクセル単位で設定します。
|
|
549
|
+
* @ko 글자 크기를 픽셀 단위로 설정합니다.
|
|
550
|
+
*/
|
|
551
|
+
setCharacterSize(this: TextResource, size: number): void { this.set(0, fontUnsigned(size)); }
|
|
552
|
+
/**
|
|
553
|
+
* Returns the character size in pixels.
|
|
554
|
+
* @zh 返回像素字号。
|
|
555
|
+
* @ja 文字サイズをピクセル単位で返します。
|
|
556
|
+
* @ko 글자 크기를 픽셀 단위로 반환합니다.
|
|
557
|
+
*/
|
|
558
|
+
getCharacterSize(): number { return this.words[0]; }
|
|
559
|
+
/**
|
|
560
|
+
* Sets the letter spacing factor; 1 is the default spacing.
|
|
561
|
+
* @zh 设置字间距倍率,1 为默认间距。
|
|
562
|
+
* @ja 文字間隔の倍率を設定します。1 は既定の間隔です。
|
|
563
|
+
* @ko 자간 배율을 설정합니다. 1은 기본 간격입니다.
|
|
564
|
+
*/
|
|
565
|
+
setLetterSpacing(this: TextResource, factor: number): void { this.set(1, textFloat(factor)); }
|
|
566
|
+
/**
|
|
567
|
+
* Returns the letter spacing factor.
|
|
568
|
+
* @zh 返回字间距倍率。
|
|
569
|
+
* @ja 文字間隔の倍率を返します。
|
|
570
|
+
* @ko 자간 배율을 반환합니다.
|
|
571
|
+
*/
|
|
572
|
+
getLetterSpacing(): number { return this.floats[1]; }
|
|
573
|
+
/**
|
|
574
|
+
* Sets the line spacing factor; 1 is the font's default line spacing.
|
|
575
|
+
* @zh 设置行间距倍率,1 为字体默认行距。
|
|
576
|
+
* @ja 行間隔の倍率を設定します。1 はフォント既定の行間隔です。
|
|
577
|
+
* @ko 줄 간격 배율을 설정합니다. 1은 글꼴의 기본 줄 간격입니다.
|
|
578
|
+
*/
|
|
579
|
+
setLineSpacing(this: TextResource, factor: number): void { this.set(2, textFloat(factor)); }
|
|
580
|
+
/**
|
|
581
|
+
* Returns the line spacing factor.
|
|
582
|
+
* @zh 返回行间距倍率。
|
|
583
|
+
* @ja 行間隔の倍率を返します。
|
|
584
|
+
* @ko 줄 간격 배율을 반환합니다.
|
|
585
|
+
*/
|
|
586
|
+
getLineSpacing(): number { return this.floats[2]; }
|
|
587
|
+
/**
|
|
588
|
+
* Sets TextStyle bit flags, combining styles such as bold and italic.
|
|
589
|
+
* @zh 设置 TextStyle 位标志,可组合粗体、斜体等样式。
|
|
590
|
+
* @ja TextStyle ビットフラグを設定します。太字や斜体などを組み合わせられます。
|
|
591
|
+
* @ko TextStyle 비트 플래그를 설정하며 굵게, 기울임꼴 등의 스타일을 조합할 수 있습니다.
|
|
592
|
+
*/
|
|
593
|
+
setStyle(this: TextResource, style: TextStyle): void { this.set(3, fontUnsigned(style, 15)); }
|
|
594
|
+
/**
|
|
595
|
+
* Returns the text style bit flags.
|
|
596
|
+
* @zh 返回文本样式位标志。
|
|
597
|
+
* @ja テキストスタイルのビットフラグを返します。
|
|
598
|
+
* @ko 텍스트 스타일 비트 플래그를 반환합니다.
|
|
599
|
+
*/
|
|
600
|
+
getStyle(): TextStyle { return this.words[3]; }
|
|
601
|
+
/**
|
|
602
|
+
* Copies the fill color; existing geometry is only recolored.
|
|
603
|
+
* @zh 复制填充颜色;已有几何仅重新着色。
|
|
604
|
+
* @ja 塗りつぶし色をコピーします。既存ジオメトリは色のみを更新します。
|
|
605
|
+
* @ko 채우기 색상을 복사합니다. 기존 기하 구조는 색상만 갱신합니다.
|
|
606
|
+
*/
|
|
607
|
+
setFillColor(this: TextResource, color: R<Color>): void { this.setColor(4, colorInteger(color)); }
|
|
608
|
+
/**
|
|
609
|
+
* Returns a copy of the fill color.
|
|
610
|
+
* @zh 返回填充颜色副本。
|
|
611
|
+
* @ja 塗りつぶし色のコピーを返します。
|
|
612
|
+
* @ko 채우기 색상 복사본을 반환합니다.
|
|
613
|
+
*/
|
|
614
|
+
getFillColor(): Color { return new Color(this.colors.getUint32(16)); }
|
|
615
|
+
/**
|
|
616
|
+
* Copies the outline color; existing geometry is only recolored.
|
|
617
|
+
* @zh 复制轮廓颜色;已有几何仅重新着色。
|
|
618
|
+
* @ja 輪郭色をコピーします。既存ジオメトリは色のみを更新します。
|
|
619
|
+
* @ko 윤곽선 색상을 복사합니다. 기존 기하 구조는 색상만 갱신합니다.
|
|
620
|
+
*/
|
|
621
|
+
setOutlineColor(this: TextResource, color: R<Color>): void { this.setColor(5, colorInteger(color)); }
|
|
622
|
+
/**
|
|
623
|
+
* Returns a copy of the outline color.
|
|
624
|
+
* @zh 返回轮廓颜色副本。
|
|
625
|
+
* @ja 輪郭色のコピーを返します。
|
|
626
|
+
* @ko 윤곽선 색상 복사본을 반환합니다.
|
|
627
|
+
*/
|
|
628
|
+
getOutlineColor(): Color { return new Color(this.colors.getUint32(20)); }
|
|
629
|
+
/**
|
|
630
|
+
* Sets the outline thickness in pixels.
|
|
631
|
+
* @zh 设置轮廓像素厚度。
|
|
632
|
+
* @ja 輪郭の太さをピクセル単位で設定します。
|
|
633
|
+
* @ko 윤곽선 두께를 픽셀 단위로 설정합니다.
|
|
634
|
+
*/
|
|
635
|
+
setOutlineThickness(this: TextResource, thickness: number): void { this.set(6, textFloat(thickness)); }
|
|
636
|
+
/**
|
|
637
|
+
* Returns the outline thickness in pixels.
|
|
638
|
+
* @zh 返回轮廓像素厚度。
|
|
639
|
+
* @ja 輪郭の太さをピクセル単位で返します。
|
|
640
|
+
* @ko 윤곽선 두께를 픽셀 단위로 반환합니다.
|
|
641
|
+
*/
|
|
642
|
+
getOutlineThickness(): number { return this.floats[6]; }
|
|
643
|
+
/**
|
|
644
|
+
* Sets the alignment of multiline text.
|
|
645
|
+
* @zh 设置多行文本的对齐方式。
|
|
646
|
+
* @ja 複数行テキストの配置を設定します。
|
|
647
|
+
* @ko 여러 줄 텍스트의 정렬을 설정합니다.
|
|
648
|
+
*/
|
|
649
|
+
setLineAlignment(this: TextResource, alignment: LineAlignment): void { this.set(7, fontUnsigned(alignment, 3)); }
|
|
650
|
+
/**
|
|
651
|
+
* Returns line alignment.
|
|
652
|
+
* @zh 返回行对齐方式。
|
|
653
|
+
* @ja 行の配置を返します。
|
|
654
|
+
* @ko 행 정렬을 반환합니다.
|
|
655
|
+
*/
|
|
656
|
+
getLineAlignment(): LineAlignment { return this.words[7]; }
|
|
657
|
+
/**
|
|
658
|
+
* Sets horizontal or vertical writing direction.
|
|
659
|
+
* @zh 设置横排或竖排方向。
|
|
660
|
+
* @ja 横書きまたは縦書きの方向を設定します。
|
|
661
|
+
* @ko 가로쓰기 또는 세로쓰기 방향을 설정합니다.
|
|
662
|
+
*/
|
|
663
|
+
setTextOrientation(this: TextResource, orientation: TextOrientation): void { this.set(8, fontUnsigned(orientation, 2)); }
|
|
664
|
+
/**
|
|
665
|
+
* Returns text writing direction.
|
|
666
|
+
* @zh 返回文本排版方向。
|
|
667
|
+
* @ja テキストの組版方向を返します。
|
|
668
|
+
* @ko 텍스트 쓰기 방향을 반환합니다.
|
|
669
|
+
*/
|
|
670
|
+
getTextOrientation(): TextOrientation { return this.words[8]; }
|
|
671
|
+
/**
|
|
672
|
+
* Sets the glyph cluster grouping strategy for shaping.
|
|
673
|
+
* @zh 设置整形时的字形簇分组策略。
|
|
674
|
+
* @ja シェーピング時のグリフクラスターのグループ化方針を設定します。
|
|
675
|
+
* @ko 셰이핑 시 글리프 클러스터 그룹화 방식을 설정합니다.
|
|
676
|
+
*/
|
|
677
|
+
setClusterGrouping(this: TextResource, grouping: ClusterGrouping): void { this.set(9, fontUnsigned(grouping, 2)); }
|
|
678
|
+
/**
|
|
679
|
+
* Returns the glyph cluster grouping strategy.
|
|
680
|
+
* @zh 返回字形簇分组策略。
|
|
681
|
+
* @ja グリフクラスターのグループ化方針を返します。
|
|
682
|
+
* @ko 글리프 클러스터 그룹화 방식을 반환합니다.
|
|
683
|
+
*/
|
|
684
|
+
getClusterGrouping(): ClusterGrouping { return this.words[9]; }
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Sets a synchronous glyph appearance callback, or null to remove it; the
|
|
688
|
+
* callback runs when geometry is rebuilt.
|
|
689
|
+
* @zh 设置同步字形外观回调,null 取消;回调在几何重建时执行。
|
|
690
|
+
* @ja 同期グリフ外観コールバックを設定し、null で解除します。コールバックはジオメトリ再構築時に実行されます。
|
|
691
|
+
* @ko 동기 글리프 외형 콜백을 설정하며 null은 해제합니다. 콜백은 기하 구조를 재구성할 때 실행됩니다.
|
|
692
|
+
*/
|
|
693
|
+
setGlyphPreProcessor(this: TextResource, processor: GlyphPreProcessor | null): void {
|
|
694
|
+
this.checkIdle();
|
|
695
|
+
if (processor !== null && typeof processor !== 'function') {
|
|
696
|
+
throw new TypeError('Expected a glyph pre-processor or null');
|
|
697
|
+
}
|
|
698
|
+
this.processor = processor;
|
|
699
|
+
this.geometry[0] = 1;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Shapes on demand and returns glyph layout views; cluster is a JS UTF-16
|
|
704
|
+
* index.
|
|
705
|
+
* @zh 按需整形并返回字形布局视图;cluster 为 JS UTF-16 索引。
|
|
706
|
+
* @ja 必要に応じてシェーピングし、グリフ配置ビューを返します。cluster は JS UTF-16 インデックスです。
|
|
707
|
+
* @ko 필요할 때 셰이핑하고 글리프 배치 뷰를 반환합니다. cluster는 JS UTF-16 인덱스입니다.
|
|
708
|
+
*/
|
|
709
|
+
getShapedGlyphs(): readonly ShapedGlyph[] {
|
|
710
|
+
this.prepare();
|
|
711
|
+
if (!this.glyphs) {
|
|
712
|
+
const buffer = new ShapedGlyphBuffer(native.getTextGlyphs(this[graphicsNative]));
|
|
713
|
+
const indices = this.getIndices();
|
|
714
|
+
this.glyphs = Array.from({ length: buffer.length },
|
|
715
|
+
(_, index) => new ShapedGlyphView(buffer, index, indices));
|
|
716
|
+
}
|
|
717
|
+
return this.glyphs;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Returns mutable fill vertex data; retrieve it again after the next geometry
|
|
721
|
+
* rebuild.
|
|
722
|
+
* @zh 返回可修改的填充顶点数据;下一次几何重建后需要重新获取。
|
|
723
|
+
* @ja 変更可能な塗りつぶし頂点データを返します。次のジオメトリ再構築後は再取得が必要です。
|
|
724
|
+
* @ko 수정 가능한 채우기 꼭짓점 데이터를 반환합니다. 다음 기하 구조 재구성 후 다시 가져와야 합니다.
|
|
725
|
+
*/
|
|
726
|
+
getVertexData(): VertexArray { this.prepare(); return this.vertices; }
|
|
727
|
+
/**
|
|
728
|
+
* Returns mutable outline vertex data; retrieve it again after the next
|
|
729
|
+
* geometry rebuild.
|
|
730
|
+
* @zh 返回可修改的轮廓顶点数据;下一次几何重建后需要重新获取。
|
|
731
|
+
* @ja 変更可能な輪郭頂点データを返します。次のジオメトリ再構築後は再取得が必要です。
|
|
732
|
+
* @ko 수정 가능한 윤곽선 꼭짓점 데이터를 반환합니다. 다음 기하 구조 재구성 후 다시 가져와야 합니다.
|
|
733
|
+
*/
|
|
734
|
+
getOutlineVertexData(): VertexArray { this.prepare(); return this.outline; }
|
|
735
|
+
/**
|
|
736
|
+
* Returns the local axis-aligned bounds of the shaped text.
|
|
737
|
+
* @zh 返回整形后文本的局部轴对齐包围框。
|
|
738
|
+
* @ja シェーピング済みテキストのローカル軸平行境界矩形を返します。
|
|
739
|
+
* @ko 셰이핑된 텍스트의 로컬 축 정렬 경계 상자를 반환합니다.
|
|
740
|
+
*/
|
|
741
|
+
getLocalBounds(): FloatRect {
|
|
742
|
+
this.prepare();
|
|
743
|
+
const [ x, y, w, h ] = this.bounds;
|
|
744
|
+
return new FloatRect(new Vector2f(x, y), new Vector2f(w, h));
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Returns world coordinates of the specified character; index counts Unicode
|
|
749
|
+
* code points.
|
|
750
|
+
* @zh 返回指定字符的世界坐标,index 按 Unicode 码点计数。
|
|
751
|
+
* @ja 指定文字のワールド座標を返します。index は Unicode コードポイント単位です。
|
|
752
|
+
* @ko 지정한 문자의 월드 좌표를 반환합니다. index는 Unicode 코드 포인트 단위로 셉니다.
|
|
753
|
+
*
|
|
754
|
+
* @deprecated Use getShapedGlyphs() to obtain the complete layout.
|
|
755
|
+
* @zh 使用 getShapedGlyphs() 获取完整布局。
|
|
756
|
+
* @ja 完全なレイアウトを取得するには getShapedGlyphs() を使ってください。
|
|
757
|
+
* @ko 전체 배치를 얻으려면 getShapedGlyphs()를 사용하세요.
|
|
758
|
+
*/
|
|
759
|
+
findCharacterPos(this: Text, index: number): Vector2f {
|
|
760
|
+
if (!Number.isSafeInteger(index) || index < 0) throw new RangeError('Invalid character index');
|
|
761
|
+
this.prepare();
|
|
762
|
+
flushGraphics();
|
|
763
|
+
return this.getTransform().transformPoint(
|
|
764
|
+
new Vector2f(...native.findTextCharacter(this[graphicsNative], index)));
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
protected draw(this: Text, target: RenderTarget, states: RenderStates): void {
|
|
768
|
+
this.prepare();
|
|
769
|
+
const combined = new RenderStates(states);
|
|
770
|
+
combined.transform.combine(this.getTransform());
|
|
771
|
+
combined.texture = this.font.getTexture(this.getCharacterSize());
|
|
772
|
+
combined.coordinateType = CoordinateType.Pixels;
|
|
773
|
+
if (this.outline.getVertexCount()) {
|
|
774
|
+
target[recordVertices](this.outline[vertexArrayBytes],
|
|
775
|
+
this.outline.getPrimitiveType(), combined);
|
|
776
|
+
}
|
|
777
|
+
if (this.vertices.getVertexCount()) {
|
|
778
|
+
target[recordVertices](this.vertices[vertexArrayBytes],
|
|
779
|
+
this.vertices.getPrimitiveType(), combined);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
[dispatchDrawable](this: Text, target: RenderTarget, states: RenderStates): void {
|
|
784
|
+
if (this.draw === TextResource.prototype.draw) this.draw(target, states);
|
|
785
|
+
else super[dispatchDrawable](target, states);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Writes Native parameter fields and marks geometry dirty only when the value
|
|
790
|
+
* changes.
|
|
791
|
+
* @zh 仅当值变化时写入 Native 参数字段并标记几何脏。
|
|
792
|
+
* @ja 値が変わった場合のみ Native パラメーターフィールドを書き込み、ジオメトリを更新必要としてマークします。
|
|
793
|
+
* @ko 값이 바뀔 때만 Native 매개변수 필드에 쓰고 기하 구조 변경을 표시합니다.
|
|
794
|
+
*/
|
|
795
|
+
private set(index: number, value: number): void {
|
|
796
|
+
this.checkIdle();
|
|
797
|
+
const data = index === 1 || index === 2 || index === 6
|
|
798
|
+
? this.floats : this.words;
|
|
799
|
+
if (data[index] === value) return;
|
|
800
|
+
data[index] = value;
|
|
801
|
+
this.geometry[0] = 1;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Sets fill or outline color; directly updates vertex data for color-only
|
|
806
|
+
* changes.
|
|
807
|
+
* @zh 设置填充或轮廓颜色;仅着色时直接更新顶点数据。
|
|
808
|
+
* @ja 塗りつぶし色または輪郭色を設定します。色のみの変更では頂点データを直接更新します。
|
|
809
|
+
* @ko 채우기 또는 윤곽선 색상을 설정합니다. 색상만 변경할 때는 꼭짓점 데이터를 직접 갱신합니다.
|
|
810
|
+
*/
|
|
811
|
+
private setColor(index: 4 | 5, value: number): void {
|
|
812
|
+
this.checkIdle();
|
|
813
|
+
if (this.colors.getUint32(index * 4) === value) return;
|
|
814
|
+
this.colors.setUint32(index * 4, value);
|
|
815
|
+
// SFML recolors existing geometry without reshaping or running callbacks.
|
|
816
|
+
if (this.geometry[0] || !this.vertices) return;
|
|
817
|
+
const vertices = index === 4 ? this.vertices : this.outline;
|
|
818
|
+
const bytes = vertices[vertexArrayBytes];
|
|
819
|
+
for (let offset = 8; offset < bytes.length; offset += 20) {
|
|
820
|
+
for (let channel = 0; channel < 4; channel++) {
|
|
821
|
+
bytes[offset + channel] = this.colors.getUint8(index * 4 + channel);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Throws when called within a preprocessor callback.
|
|
828
|
+
* @zh 在预处理器回调中执行时抛出。
|
|
829
|
+
* @ja プリプロセッサーコールバック内で実行された場合に例外を投げます。
|
|
830
|
+
* @ko 전처리기 콜백 안에서 실행되면 예외를 던집니다.
|
|
831
|
+
*/
|
|
832
|
+
private checkIdle(): void {
|
|
833
|
+
if (this.preparing) throw new SFMLError('Cannot update or query text geometry in its glyph pre-processor');
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Lazily creates an index from UTF-16 to Unicode glyph ranges.
|
|
838
|
+
* @zh 惰性创建 UTF-16 到 Unicode 字形范围的索引。
|
|
839
|
+
* @ja UTF-16 から Unicode グリフ範囲へのインデックスを遅延作成します。
|
|
840
|
+
* @ko UTF-16에서 Unicode 글리프 범위로의 인덱스를 지연 생성합니다.
|
|
841
|
+
*/
|
|
842
|
+
private getIndices(): TextIndices {
|
|
843
|
+
this.indices ??= new TextIndices(this.string);
|
|
844
|
+
return this.indices;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Performs text shaping and geometry rebuilding on demand.
|
|
849
|
+
* @zh 按需执行文本整形和几何重建。
|
|
850
|
+
* @ja 必要に応じてテキストのシェーピングとジオメトリ再構築を実行します。
|
|
851
|
+
* @ko 필요할 때 텍스트 셰이핑과 기하 구조 재구성을 수행합니다.
|
|
852
|
+
*/
|
|
853
|
+
private prepare(): void {
|
|
854
|
+
this.checkIdle();
|
|
855
|
+
if (!this.geometry[0] && this.revision === this.font[fontRevision]) return;
|
|
856
|
+
this.preparing = true;
|
|
857
|
+
try {
|
|
858
|
+
let callback: NativeGlyphProcessor | null = null;
|
|
859
|
+
const processor = this.processor;
|
|
860
|
+
if (processor) {
|
|
861
|
+
const indices = this.getIndices();
|
|
862
|
+
callback = (glyph, style, fill, outline, thickness) => {
|
|
863
|
+
let fillColor = new Color(fill);
|
|
864
|
+
let outlineColor = new Color(outline);
|
|
865
|
+
const appearance: GlyphAppearance = {
|
|
866
|
+
style,
|
|
867
|
+
get fillColor() { return fillColor; },
|
|
868
|
+
set fillColor(value) { fillColor = new Color(value); },
|
|
869
|
+
get outlineColor() { return outlineColor; },
|
|
870
|
+
set outlineColor(value) { outlineColor = new Color(value); },
|
|
871
|
+
outlineThickness: thickness,
|
|
872
|
+
};
|
|
873
|
+
processor(new ShapedGlyphView(
|
|
874
|
+
new ShapedGlyphBuffer(glyph), 0, indices), appearance);
|
|
875
|
+
return new Float64Array([
|
|
876
|
+
fontUnsigned(appearance.style, 15), colorInteger(appearance.fillColor),
|
|
877
|
+
colorInteger(appearance.outlineColor), textFloat(appearance.outlineThickness),
|
|
878
|
+
]);
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
flushGraphics();
|
|
882
|
+
const layout = native.prepareText(this[graphicsNative],
|
|
883
|
+
this.font[graphicsNative], this.string, callback);
|
|
884
|
+
this.vertices = vertexArrayFromMapping(layout.vertices);
|
|
885
|
+
this.outline = vertexArrayFromMapping(layout.outline);
|
|
886
|
+
this.glyphs = undefined;
|
|
887
|
+
this.revision = this.font[fontRevision];
|
|
888
|
+
} finally { this.preparing = false; }
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* SFML shaping with native vertex storage and batched draw snapshots.
|
|
894
|
+
* @zh 使用原生顶点存储和批量绘制快照的 SFML 文本整形。
|
|
895
|
+
* @ja ネイティブ頂点ストレージとバッチ描画スナップショットを使う SFML シェーピング。
|
|
896
|
+
* @ko 네이티브 꼭짓점 저장 공간과 배치 그리기 스냅샷을 사용하는 SFML 셰이핑입니다.
|
|
897
|
+
*/
|
|
898
|
+
export class Text extends withTransformable(TextResource) {
|
|
899
|
+
/**
|
|
900
|
+
* Text style bit flags.
|
|
901
|
+
* @zh 文本样式位标志。
|
|
902
|
+
* @ja テキストスタイルのビットフラグ。
|
|
903
|
+
* @ko 텍스트 스타일 비트 플래그입니다.
|
|
904
|
+
*/
|
|
905
|
+
static readonly Style = TextStyle;
|
|
906
|
+
/**
|
|
907
|
+
* Line alignment enumeration.
|
|
908
|
+
* @zh 行对齐枚举。
|
|
909
|
+
* @ja 行配置の列挙型。
|
|
910
|
+
* @ko 행 정렬 열거형입니다.
|
|
911
|
+
*/
|
|
912
|
+
static readonly LineAlignment = LineAlignment;
|
|
913
|
+
/**
|
|
914
|
+
* Glyph cluster grouping enumeration.
|
|
915
|
+
* @zh 字形簇分组枚举。
|
|
916
|
+
* @ja グリフクラスターのグループ化の列挙型。
|
|
917
|
+
* @ko 글리프 클러스터 그룹화 열거형입니다.
|
|
918
|
+
*/
|
|
919
|
+
static readonly ClusterGrouping = ClusterGrouping;
|
|
920
|
+
/**
|
|
921
|
+
* Glyph layout direction enumeration.
|
|
922
|
+
* @zh 字形排布方向枚举。
|
|
923
|
+
* @ja グリフ配置方向の列挙型。
|
|
924
|
+
* @ko 글리프 배치 방향 열거형입니다.
|
|
925
|
+
*/
|
|
926
|
+
static readonly TextDirection = TextDirection;
|
|
927
|
+
/**
|
|
928
|
+
* Horizontal and vertical writing direction enumeration.
|
|
929
|
+
* @zh 横排和竖排方向枚举。
|
|
930
|
+
* @ja 横書きと縦書きの方向の列挙型。
|
|
931
|
+
* @ko 가로쓰기 및 세로쓰기 방향 열거형입니다.
|
|
932
|
+
*/
|
|
933
|
+
static readonly TextOrientation = TextOrientation;
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Returns text axis-aligned bounds after applying the object's transform.
|
|
937
|
+
* @zh 返回应用对象变换后的文本轴对齐包围框。
|
|
938
|
+
* @ja オブジェクトの変換を適用したテキストの軸平行境界矩形を返します。
|
|
939
|
+
* @ko 객체 변환을 적용한 텍스트의 축 정렬 경계 상자를 반환합니다.
|
|
940
|
+
*/
|
|
941
|
+
getGlobalBounds(): FloatRect {
|
|
942
|
+
return this.getTransform().transformRect(this.getLocalBounds());
|
|
943
|
+
}
|
|
944
|
+
}
|