frame, realFrame, or something else as equivalent of RGSS viewport

Lihinel

Veteran
Veteran
Joined
Nov 9, 2013
Messages
271
Reaction score
339
First Language
German
Primarily Uses
Thought I figured out how to use the JS equivalent of viewport with frame, and it does seem to work in my Title Screen plugin:
Scene_Title.prototype.drawBackground = function() {
var bitmap = ImageManager.loadTitle1('TitleBG');
var bg = new Sprite(bitmap);
this._bg = bg;
this._bg._frame = new Rectangle(0,0,100,100);
this.addChild(bg);
}

But when I copy the method to a new Scene and change the Scene_Title to Scene_Test it displays the entire image instead of just a 100 by 100 box in the top left corner of the screen.

(realFrame doens't seem to work either, I used https://kinoar.github.io/rmmv-doc-web/classes/sprite.html as reference, if you got a better one, I'd be glad since all the links to the details seem to lead to a 404)
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,708
First Language
Czech
Primarily Uses
RMMV
Actually, if you want to influence frame, you need to influence texture's frame (in this case it could be the bitmap as well I guess), not the sprite's frame. If you want to deal with sprites, you need to assign a PIXI mask filter to them.
 

Latest Threads

Latest Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,287
Messages
1,088,660
Members
149,913
Latest member
badalias
Top