add setBackgroundImageFromTexture method to ThermionViewer
This commit is contained in:
@@ -223,6 +223,14 @@ class ThermionViewerFFI extends ThermionViewer {
|
|||||||
return _backgroundImage!;
|
return _backgroundImage!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
Future setBackgroundImageFromTexture(Texture texture) async {
|
||||||
|
var backgroundImage = await getBackgroundImage();
|
||||||
|
await backgroundImage.setImageFromTexture(texture);
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
@@ -683,6 +691,7 @@ class ThermionViewerFFI extends ThermionViewer {
|
|||||||
///
|
///
|
||||||
Future setGridOverlayVisibility(bool visible) async {
|
Future setGridOverlayVisibility(bool visible) async {
|
||||||
_grid ??= _grid = await GridOverlay.create(app, animationManager);
|
_grid ??= _grid = await GridOverlay.create(app, animationManager);
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
await scene.add(_grid!);
|
await scene.add(_grid!);
|
||||||
await view.setLayerVisibility(VisibilityLayers.OVERLAY, true);
|
await view.setLayerVisibility(VisibilityLayers.OVERLAY, true);
|
||||||
|
|||||||
@@ -59,13 +59,18 @@ abstract class ThermionViewer {
|
|||||||
Future dispose();
|
Future dispose();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the background image to [path] (which should have a file extension .png, .jpg, or .ktx).
|
/// Set the background image to [path] (which should be .png, .jpg, or .ktx
|
||||||
/// This will be rendered at the maximum depth (i.e. behind all other objects including the skybox).
|
/// file). This will be rendered at the maximum depth (i.e. behind all other objects including the skybox).
|
||||||
/// If [fillHeight] is false, the image will be rendered at its original size. Note this may cause issues with pixel density so be sure to specify the correct resolution
|
/// If [fillHeight] is false, the image will be rendered at its original size. Note this may cause issues with pixel density so be sure to specify the correct resolution
|
||||||
/// If [fillHeight] is true, the image will be stretched/compressed to fit the height of the viewport.
|
/// If [fillHeight] is true, the image will be stretched/compressed to fit the height of the viewport.
|
||||||
///
|
///
|
||||||
Future setBackgroundImage(String path, {bool fillHeight = false});
|
Future setBackgroundImage(String path, {bool fillHeight = false});
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Set the background image from [texture].
|
||||||
|
///
|
||||||
|
Future setBackgroundImageFromTexture(Texture texture);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Moves the background image to the relative offset from the origin (bottom-left) specified by [x] and [y].
|
/// Moves the background image to the relative offset from the origin (bottom-left) specified by [x] and [y].
|
||||||
/// If [clamp] is true, the image cannot be positioned outside the bounds of the viewport.
|
/// If [clamp] is true, the image cannot be positioned outside the bounds of the viewport.
|
||||||
@@ -300,7 +305,7 @@ abstract class ThermionViewer {
|
|||||||
/// If [destroy] is true, the geometry and material instance for the asset
|
/// If [destroy] is true, the geometry and material instance for the asset
|
||||||
/// will also be destroyed.
|
/// will also be destroyed.
|
||||||
///
|
///
|
||||||
Future hideBoundingBox(ThermionAsset asset, { bool destroy = false});
|
Future hideBoundingBox(ThermionAsset asset, {bool destroy = false});
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Gets the 2D bounding box (in viewport coordinates) for the given entity.
|
/// Gets the 2D bounding box (in viewport coordinates) for the given entity.
|
||||||
|
|||||||
Reference in New Issue
Block a user