Skip to content

Commit

Permalink
trying to disable background textures?
Browse files Browse the repository at this point in the history
  • Loading branch information
dpwoert committed Jan 25, 2024
1 parent 2dc87c9 commit d9f792e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/client/src/controls/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class ImageControl extends Control<string | ImageBitmap> {
) {
// if key is not present, it must be an HTMLImageElement and we can use the 'src' key
const isHTMLImageElement = !key && 'src' in reference;
super(reference || new Image(), isHTMLImageElement || !key ? 'src' : key);
super(reference, isHTMLImageElement || !key ? 'src' : key);

if (!key) {
this.label('Image');
Expand Down
16 changes: 8 additions & 8 deletions plugins/three/src/scene.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Scene, Color } from 'three';
import {
NumberControl,
// NumberControl,
Layer,
Folder,
ColorControl,
ImageControl,
// ImageControl,
} from '@magic-circle/client';

import { RecursiveSettings, recursive } from './recursive';
Expand All @@ -25,12 +25,12 @@ export function scene(scene: Scene, opts: SceneSettings = {}): Layer {
// Background
if (scene.background instanceof Color) {
background.push(new ColorControl(scene, 'background').range(1));
} else if (scene.background && scene.background?.source.data) {
background.push(
new ImageControl(scene.background?.source, 'data'),
new NumberControl(scene, 'backgroundIntensity').range(0, 1),
new NumberControl(scene, 'backgroundBlurriness').range(0, 1)
);
} else if (scene.background) {
// background.push(
// new ImageControl(scene.background?.source, 'data'),
// new NumberControl(scene, 'backgroundIntensity').range(0, 1),
// new NumberControl(scene, 'backgroundBlurriness').range(0, 1)
// );
}
new Folder('Background', background).addTo(rootLayer);

Expand Down

0 comments on commit d9f792e

Please sign in to comment.