mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
parent
9a7dbc2aca
commit
eaae4b6408
260 changed files with 5328 additions and 5474 deletions
|
@ -33,8 +33,8 @@
|
|||
#include "editor/audio_stream_preview.h"
|
||||
#include "editor_resource_preview.h"
|
||||
#include "editor_scale.h"
|
||||
#include "scene/2d/animated_sprite.h"
|
||||
#include "scene/2d/sprite.h"
|
||||
#include "scene/2d/animated_sprite_2d.h"
|
||||
#include "scene/2d/sprite_2d.h"
|
||||
#include "scene/3d/sprite_3d.h"
|
||||
#include "scene/animation/animation_player.h"
|
||||
#include "servers/audio/audio_stream.h"
|
||||
|
@ -357,7 +357,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
|||
|
||||
Size2 size;
|
||||
|
||||
if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
|
||||
Ref<Texture2D> texture = object->call("get_texture");
|
||||
if (!texture.is_valid()) {
|
||||
|
@ -379,7 +379,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
|||
if (vframes > 1) {
|
||||
size.y /= vframes;
|
||||
}
|
||||
} else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
|
||||
} else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
|
||||
|
||||
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
|
||||
if (sf.is_null()) {
|
||||
|
@ -436,7 +436,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
|||
Ref<Texture2D> texture;
|
||||
Rect2 region;
|
||||
|
||||
if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
|
||||
texture = object->call("get_texture");
|
||||
if (!texture.is_valid()) {
|
||||
|
@ -473,7 +473,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
|||
region.position.x += region.size.x * coords.x;
|
||||
region.position.y += region.size.y * coords.y;
|
||||
|
||||
} else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
|
||||
} else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
|
||||
|
||||
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
|
||||
if (sf.is_null()) {
|
||||
|
@ -1300,14 +1300,14 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj
|
|||
return audio;
|
||||
}
|
||||
|
||||
if (p_property == "frame" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite") || p_object->is_class("AnimatedSprite3D"))) {
|
||||
if (p_property == "frame" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite2D") || p_object->is_class("AnimatedSprite3D"))) {
|
||||
|
||||
AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame);
|
||||
sprite->set_node(p_object);
|
||||
return sprite;
|
||||
}
|
||||
|
||||
if (p_property == "frame_coords" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D"))) {
|
||||
if (p_property == "frame_coords" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D"))) {
|
||||
|
||||
AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame);
|
||||
sprite->set_as_coords();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue