mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
wip
This commit is contained in:
parent
27fff648b6
commit
cdbf5c843f
5 changed files with 15 additions and 2 deletions
|
|
@ -104,6 +104,10 @@ export abstract class EngineBase<EVs extends EngineBaseEvents> extends EventEmit
|
|||
this.emit('ev', { type, ctx });
|
||||
}
|
||||
|
||||
public async takeScreenshot() {
|
||||
return await BABYLON.Tools.CreateScreenshotAsync(this.engine, this.scene.activeCamera!, { precision: 1 });
|
||||
}
|
||||
|
||||
public abstract resize(): void;
|
||||
|
||||
public destroy() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<button v-if="controller.isEditMode.value" :class="$style.topMenuButton" class="_button" @click="showSnappingMenu"><i class="ti ti-grid-4x4"></i></button>
|
||||
<button v-if="controller.isEditMode.value && !isRoomSettingsOpen" :class="$style.topMenuButton" class="_button" @click="() => isRoomSettingsOpen = true"><i class="ti ti-home-cog"></i></button>
|
||||
<button v-if="controller.isEditMode.value && isRoomSettingsOpen" :class="$style.topMenuButton" class="_button" style="color: var(--MI_THEME-accent)" @click="() => isRoomSettingsOpen = false"><i class="ti ti-home-cog"></i></button>
|
||||
<button :class="$style.topMenuButton" class="_button" @click="takeScreenshot"><i class="ti ti-camera"></i></button>
|
||||
</template>
|
||||
<button :class="$style.topMenuButton" class="_button" @click="showOtherMenu"><i class="ti ti-dots"></i></button>
|
||||
</div>
|
||||
|
|
@ -518,6 +519,10 @@ async function refresh() {
|
|||
await controller.reset(canvas.value!, attachments, null, roomControllerOptions.value);
|
||||
}
|
||||
|
||||
async function takeScreenshot() {
|
||||
console.log(await controller.takeScreenshot());
|
||||
}
|
||||
|
||||
// TODO: ちゃんと書く
|
||||
function expor() {
|
||||
const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { EngineControllerBase } from './engineControllerBase.js';
|
||||
import { EngineControllerBase } from './EngineControllerBase.js';
|
||||
import type { PlayerProfile } from 'misskey-world-engine/src/PlayerContainer.js';
|
||||
import type { AvatarPreviewEngine } from 'misskey-world-engine/src/avatarPreviewEngine.js';
|
||||
import type { WorldAvatar } from 'misskey-world/src/types.js';
|
||||
|
|
|
|||
|
|
@ -329,6 +329,10 @@ export abstract class EngineControllerBase<T extends EngineBase<EngineBaseEvents
|
|||
this.call('resumeRender');
|
||||
}
|
||||
|
||||
public takeScreenshot() {
|
||||
return this.callAndWaitReturn('takeScreenshot');
|
||||
}
|
||||
|
||||
public resize() {
|
||||
if (this.canvas == null) return;
|
||||
const width = this.canvas.clientWidth;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { ref, shallowRef } from 'vue';
|
|||
import { cm } from 'misskey-world/src/utility.js';
|
||||
import { EngineControllerBase } from '../EngineControllerBase.js';
|
||||
import type { ShallowRef } from 'vue';
|
||||
import type { RoomState_InstalledFurniture } from 'misskey-world/src/room/object.js';
|
||||
import type { RoomState_InstalledFurniture } from 'misskey-world/src/room/furniture.js';
|
||||
import type { RoomEngine } from 'misskey-world-engine/src/room/engine.js';
|
||||
import type { RoomAttachments, RoomState } from 'misskey-world/src/room/type.js';
|
||||
import type { PlayerProfile, PlayerState } from 'misskey-world-engine/src/PlayerContainer.js';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue