您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
1.1 KiB
31 行
1.1 KiB
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.rendering;
|
|
using Unity.UIWidgets.ui;
|
|
|
|
namespace Unity.UIWidgets.widgets {
|
|
public class Texture : LeafRenderObjectWidget {
|
|
// TODO: check whether following is needed
|
|
// public static void textureFrameAvailable(Window instance = null) {
|
|
// if (instance == null) {
|
|
// WindowAdapter.windowAdapters.ForEach(w => w.scheduleFrame(false));
|
|
// } else {
|
|
// instance.scheduleFrame(false);
|
|
// }
|
|
// }
|
|
|
|
public Texture( Key key = null, int? textureId = null) : base(key: key) {
|
|
D.assert(textureId != null);
|
|
this.textureId = textureId.Value;
|
|
}
|
|
|
|
public readonly int textureId;
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) {
|
|
return new TextureBox(textureId: textureId);
|
|
}
|
|
|
|
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
|
|
((TextureBox) renderObject).textureId = textureId;
|
|
}
|
|
}
|
|
}
|