Alright, I'll answer in order
1. If you want to easily access the images you add dynamically, instead of setting the Sprite to a local Variable inside of the function, you could create a variable
outside of the function, making it global.
JavaScript:
let mySprite = {};
//now mySprite is global, and can be accessed once the game has launched.
//You could also do $gameVariables.setValue(id, PIXI.Sprite(Bitmap.load(filepath))),
//which will set the game variable with the id you specify to the value of that sprite
let sp_aliasonMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function(){
sp_aliasonMapLoaded.call(this);
mySprite = new Sprite(Bitmap.load("img/pictures/Atticus1_1.png"));
let shaderTileMap = this._spriteset.children[0].children[2]
shaderTileMap.addChildAt(mySprite, 0);
}
Now, you can access the variable (be it a custom global or a game variable) at any time after the map loads.
mySprite.x = 100;
mySprite.y += 300;
You can just access the x and y properties of the Sprite inside of the variable to move it around.
2. You can change the .height and .width properties the same way you can change the x and y properties
mysprite.width = 100;
mySprite.height *= 1.5;
3. When dealing with images in the way I showed, the layers are actually in order of the position in the .children 'array'. So in my example, using
.addChildAt(mySprite, 0)
Makes it so that it is the bottom layer. The layers are essentially in order of lowest number to highest, only starting with 0, instead of 1. Pretty much the same as specifying it with Show Picture, you can actually specify the index. 3 would be on top of 2, 1, and 0. Index 10 would be under everything 11 and up, and below everything 9 and under.
4. Yes, it is, but it's actually easier to do if you already have a variable that holds the image.
If your global variable was called
mySpriteLayerTwo
You could do the following to change the image used.
mySpriteLayerTwo.bitmap = Bitmap.load("img/pictures/aDifferentImagePath.png");
This will change it dynamically, and can be done in events. All you need is a way to reference the sprite in question, which is much easier to do if you have it store somewhere.
(FYI, you could search the shaderTileMap dynamically for the image by iterating through the children of the tilemap and checking for the
.bitmap.url
property to see if it matches the image path you're looking for, but that could be a pain)
5. That's definitely possible, although it would likely require enough work to where it would be better to not even bother with Show Picture. This is because you'd ultimately wind up having to use the Show Picture script call, because in the editor, it still wouldn't let you pick a value less than 0.
EDIT:
I'd have to look into this more, because I traditionally use PIXI.Sprite instead of the RPG Maker Sprite class, but it seems changing the width and height isn't directly working to stretch the image.
With the PIXI.Sprite class this would work fine, let me poke around and see if stretching the image is an option with the RPG Maker Sprite class. I'm sure there's some way.
EDIT AGAIN:
To change the width or height, use
mySprite.scale.set(width, height)
The x and y values are set based off of the number 1.
mySprite.scale.set(1.3, 0.2)
would result in the width being 1.3 times it's normal value, and the height would be 20% of it's normal size. Basically 1 equals 100% of it's original value