jayray

Jay Ray Games and Art Design- Oklahoma City, OK
Regular
Joined
Oct 13, 2013
Messages
157
Reaction score
100
First Language
English
Primarily Uses
RMMV
update... Using the OrangeMapshot plugin, I'm having two main issues.

The first is trying to find where to add PICTURES as another layer to add to the canvas... So that I can add this syntax to the plugin
const imageData = context.getImageData(0, 0, canvas.width, canvas.height);

const pictures = $gameScreen.pictures(); for (let i = 0; i < pictures.length; i++) { const picture = pictures; if (picture && picture.name() !== '') { const bitmap = ImageManager.loadPicture(picture.name()); context.globalAlpha = picture.opacity() / 255; context.drawImage(bitmap._canvas, picture.x(), picture.y()); } }

Then I need to know where the CANVAS is so that I can enter THIS code.

const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;

const context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);

Let me know if there's some way to actually do this? Basically, I'd like my picture layers to show up on a MapShot (OR screenshot) with a transparent background. Any solutions would be appreciated.
 

jayray

Jay Ray Games and Art Design- Oklahoma City, OK
Regular
Joined
Oct 13, 2013
Messages
157
Reaction score
100
First Language
English
Primarily Uses
RMMV
update - > this doesn't work, but I've been told the best AI in the world was responsible lol....

(function() { const filename = "Mapshot.png"; function saveMapshot() { if (!hasLoaded()) { console.log("Map data has not finished loading."); return; } const map = SceneManager._scene._spriteset._tilemap; const pictures = SceneManager._scene._spriteset._pictureContainer.children; const canvas = document.createElement("canvas"); const context = canvas.getContext("2d"); const baseTexture = map._baseTexture; const texture = new PIXI.Texture(baseTexture); const width = texture.width; const height = texture.height; canvas.width = width; canvas.height = height; context.clearRect(0, 0, width, height); context.drawImage(texture.baseTexture.source, 0, 0); for (let i = 0; i < pictures.length; i++) { const picture = pictures; const bitmap = picture.bitmap; if (bitmap) { context.save(); context.globalCompositeOperation = "destination-over"; context.translate(picture.x, picture.y); context.drawImage(bitmap.canvas, 0, 0); context.restore(); } } canvas.toBlob(function(blob) { SaveAs(blob, filename); }, "image/png"); } function hasLoaded() { const map = SceneManager._scene._map; const tilemap = SceneManager._scene._spriteset._tilemap; if (!map || !tilemap) { return false; } if (!map.isReady() || !tilemap.isReady()) { return false; } return true; } function SaveAs(blob, fileName) { const link = document.createElement("a"); link.href = URL.createObjectURL(blob); link.download = fileName; link.click(); } document.addEventListener("keydown", function(event) { if (event.shiftKey && event.keyCode === 113) { // Shift + F2 saveMapshot(); } }); })();


Here's what I'm TRYING to do.. I want to create a mapshot that saves everything in a map, including picture layers to a canvas, a canvas that is transparent, so basically as a .png file with transparency.

In context, imagine a dollmaker with picture layers that spits out a transparent PNG file with the picture layers as the layers of the composited image.
 

Tonedawg181

Tonedawg Gaming
Regular
Joined
Oct 21, 2016
Messages
79
Reaction score
35
First Language
English
Primarily Uses
RMMV
Is there any way to include yanfly's doodads when taking the screenshot?
 

jayray

Jay Ray Games and Art Design- Oklahoma City, OK
Regular
Joined
Oct 13, 2013
Messages
157
Reaction score
100
First Language
English
Primarily Uses
RMMV
I wish... and even then, stuck with a black canvas background.
 
Joined
Sep 26, 2023
Messages
2
Reaction score
1
First Language
vietnamese
Primarily Uses
RMMV
Hello, I have tried to use the plugin but it doesn't seem to work :( Nothing shows up.
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
8,253
Reaction score
3,523
First Language
Dutch
Primarily Uses
RMMV
@fentanyl_angel it does work still, read the document how to use it,
you need to playtest the game and than screenshot it so it opens the
folder where it is taken.

make sure you set the parameter (to show events, overlays etc or not).
also make sure the plugin is active in your plugin database.
 

Latest Threads

Latest Posts

Latest Profile Posts

Thanks to my last two calendar days, the goddess can now join your heroes' party and whack your enemies with the power of love!
1702314770604.png
How are you gonna use all those new resources from the calendars?
I hate driving in games. Imagine your character profile being an exceptional individual, yet when they drive, it makes them look dumb.
The flaming skeleton visited me in my dreams again. He demands the game be finished soon. I don't like the flaming skeleton. He took my cranberry juice. He doesnt even have a stomach it just spilled all over the floor.
My Game Jam entry is a bunch of mini games wrapped within an epic story that will rival the deepest plots of the earliest CRPGs! As a small spoiler, here is one example of a game you will be able to play. Anyone want to try Brat, Krampus, Santa?
so I had two plugin that essentially overwrite each other depending on where they are in the list. so I had to edit what was overwriting one into the other and now they both work. I REALLY need to sit down and just learn JavaScript. I hate that I know just enough to know I don't know NEARLY enough lol.

Forum statistics

Threads
136,918
Messages
1,271,455
Members
180,707
Latest member
bunnbunny
Top