MV Show image in item menu

I'm thinking about trying to make a plugin, but i don't have a lot of coding experience, I'm still trying to learn but here's what how the code would visually work in my head:

-Draw an image in the item scene when the item option is selected in the menu (Baseimage.png)

-Search for which Item Category is currently selected (Currently where I'm stuck)

-Replace image in the item scene depending on which Category was selected (Keyitems.png, Weapons.png etc.)

-When cancel input is pressed, revert back to (Baseimage.png)

-Remove image when item scene is exited.


I'm looking to add a backpack image in my item scene that highlights or animates a pouch opening depending on which category is selected.

I searched all over online for any kind of plugin that could achieve something similar, so i figured if i can't find one i could possibly create one myself. (Although if someone knows about something like I'm describing i would appreciate a link!)
I searched all over online for any kind of plugin that could achieve something similar...Although if someone knows about something like I'm describing i would appreciate a link!
Sure! I Googled it and see:



These may not be exactly the process you describe in your first post, but they give you existing work to ask about modifying, rather than starting with nothing.
I got similar that as grid with image (and background for the scene).

if you have YEP plugins, it has a notetag for this to show the image.
but it depends how your scene look like.

a mockup of your scene can be helpful as well so we can try to help you from there.
I got similar that as grid with image (and background for the scene).

if you have YEP plugins, it has a notetag for this to show the image.
but it depends how your scene look like.

a mockup of your scene can be helpful as well so we can try to help you from there.
Yeah sure, the images below are a rough example of what i was thinking about, i was also thinking about seeing if i can make an animation as well of the pouch/es opening after a category is selected.

And i do have the yanfly plugin collection.
than use ItemPictureImage from YEP that ATT_Turan linked, and maybe
increase the icon size in YEP_CoreEngine so it is more visible 🙂

but animated for the category require modification to the plugin,
probably with start, end, and reverse for closing?

but your back isn't centered which should be cleaner if it was ^^
but animated for the category require modification to the plugin,
probably with start, end, and reverse for closing?
Currently trying to find where in the code references the different categories, and what handles the selection of them.

Closest lead i have is from line 1084-1293 in the rpg_scenes.js file, going to sift through that until i find it. Currently using YEP_Item Categories as well, so I'm guessing i will most likely need to make a function that looks for the names of the categories and then change the image depending on which is currently selected.
but your back isn't centered which should be cleaner if it was ^^
Yeah, i just googled backpack png and added that, mostly was going for just the visual since i haven't gotten to making my own backpack pixel art yet.
than use ItemPictureImage from YEP that ATT_Turan linked, and maybe
increase the icon size in YEP_CoreEngine so it is more visible 🙂

but animated for the category require modification to the plugin,
probably with start, end, and reverse for closing?

but your back isn't centered which should be cleaner if it was ^^
Sorry on the late message, i didn't really realize how unclear i was about what the goal was😮. The main thing i wanted was the backpack to be shown on the left side of the screen(With the glowing pouches depending on the category)The right side of the images are screenshots with the backpack pasted in on the left.
ohh, you just want another picture indicating the location of the pocket from the item category. just create a new window with 0 opacity. when the index on the category window is selected refresh that "window backpack".

i think you just need the bitmap. you could check plugins that like those with show actor image in the status window.
ohh, you just want another picture indicating the location of the pocket from the item category. just create a new window with 0 opacity. when the index on the category window is selected refresh that "window backpack".

i think you just need the bitmap. you could check plugins that like those with show actor image in the status window.
TYSM!

Do you know of any links that can help with window creation? i found a video, but it doesn't really show how to add a window to a currently existing scene like the item scene.
Adding a window to the scene is easy, linking to the category is a different story.
I can try to fiddle something basic, but which plugin do you use currently
for your item scene?

as it can be important to make it work with it as some alter the scene, and can
conflict, crash or doesn't work.
Adding a window to the scene is easy, linking to the category is a different story.
I can try to fiddle something basic, but which plugin do you use currently
for your item scene?

as it can be important to make it work with it as some alter the scene, and can
conflict, crash or doesn't work.
Currently Using Yanfly's Item Core, Item Categories and Item Discard
Give this a whirl, @Heavensglaivedev . I tested it in a new game, but not with Yanfly's plugins.

I'm not super familiar with MV, but I know it has image loading delays so I'm doing some very basic preloading here. Which may not be optimized—I'm not sure how ImageManager is in MV, but this should hopefully get you going in terms of the basic setup.

game_JEwXo44WZF.gif


No credit required if it works for you.

JavaScript:
(function() {
const config = {
  // x coord of the picture
  x: 0,
  // y coord of the picture
  y: 300,
  // filename prefix of the picture
  // categories start at 0, e.g. ItemCategoryPicture0.png for 1st category
  imagePrefix: 'ItemCategoryPicture'
}
// Scene_Item
//-----------------------------------------------------------------------------
const Scene_Item_create = Scene_Item.prototype.create;
Scene_Item.prototype.create = function() {
  Scene_Item_create.apply(this)
  this.createCategorySprite()
}
Scene_Item.prototype.createCategorySprite = function() {
  this._categorySprite = new Sprite_ItemCategory();
  this._categorySprite.move(config.x, config.y)
  this._categorySprite.setCategoryWindow(this._categoryWindow)
  this.addChild(this._categorySprite)
}
// Sprite_ItemCategory
//-----------------------------------------------------------------------------
function Sprite_ItemCategory() {
  this.initialize.apply(this, arguments);
}
Sprite_ItemCategory.prototype = Object.create(Sprite_Base.prototype);
Sprite_ItemCategory.prototype.constructor = Sprite_ItemCategory;
Sprite_ItemCategory.prototype.initialize = function() {
  Sprite_Base.prototype.initialize.call(this);
  this._categoryWindow = null;
  this._categoryIndex = 0;
  this.createBitmap()
}
Sprite_ItemCategory.prototype.setCategoryWindow = function(window) {
  if (window) {
    this._categoryWindow = window;
    this.preloadBitmaps()
  }
}
Sprite_ItemCategory.prototype.categoryWindow = function() {
  return this._categoryWindow;
}
// Assume the category index is 0 at Scene start
// Would require additional logic if using cursor memory, etc.
Sprite_ItemCategory.prototype.categoryWindowIndex = function() {
  return this._categoryWindow.index() || 0;
}
Sprite_ItemCategory.prototype.createBitmap = function() {
  this.bitmap = ImageManager.loadPicture(config.imagePrefix + 0)
}
Sprite_ItemCategory.prototype.update = function() {
  Sprite_Base.prototype.update.call(this);
  if (this.categoryWindowIndex() !== this._categoryIndex) {
    this.updateIndex();
    this.updateBitmap()
  }
}
Sprite_ItemCategory.prototype.updateIndex = function() {
  this._categoryIndex = this.categoryWindowIndex()
}
Sprite_ItemCategory.prototype.updateBitmap = function() {
  this.bitmap = ImageManager.loadPicture(config.imagePrefix + this.categoryWindowIndex())
}
// Experimental
Sprite_ItemCategory.prototype.preloadBitmaps = function() {
  const images = this.categoryWindow().maxItems() - 1 || null;
  // shouldn't need to preload the first image
  for (i = 1; i <= images; i++) {
    ImageManager.loadPicture(config.imagePrefix + i)
  }
}
})();
Give this a whirl. I tested it in a new game, but not with Yanfly's plugins. I'm not super familiar with MV, but I know it has image loading issues so I'm doing some very basic preloading here.
I think doing it that way, the items will overlap as it's not a window to draw the image in it.
I would just use the blt option for the background/backpack for the location though as you
don't want it be overlapping unless you can set the sprite outside the window?

also, preload image is best from 0, but also by using galv_imageCache or just a simple
event to preload the image from picture id 1 for each of them and 1 frame in between
while the screen is black, (hacky way) but it works betters.

but nice job otherwise.
It's one sprite—there should be no overlapping of images. You could blt the image to the window, but then you'd either need to draw it on the item window itself or create a parent window for the image.

game_rWox6IcjKB.gif


The self-updating sprite is just how I would approach it personally.

If you were to draw one sprite for each image, then yes, you would get overlap and need to manage the visibility of the sprites.

Re: preloading, I'm not super-familiar with MV and best practices, but I did a quick google while typing that up and Galv's cache plugin did indeed pop up. The code I posted is not intended to be an end-to-end optimized solution in terms of caching. Although, if ImageManager works as I think/hope it does and caches the images, it might be okay.

If there's significant delay with the images, then yeah, something that can preload the images externally—like on the map—might be needed.
It's one sprite—there should be no overlapping of images. You could blt the image to the window, but then you'd either need to draw it on the item window itself or create a parent window for the image.

View attachment 321759

The self-updating sprite is just how I would approach it personally.

If you were to draw one sprite for each image, then yes, you would get overlap and need to manage the visibility of the sprites.

Re: preloading, I'm not super-familiar with MV and best practices, but I did a quick google while typing that up and Galv's cache plugin did indeed pop up. The code I posted is not intended to be an end-to-end optimized solution in terms of caching. Although, if ImageManager works as I think/hope it does and caches the images, it might be okay.

If there's significant delay with the images, then yeah, something that can preload the images externally—like on the map—might be needed.
it works perfect! I can't thank all of you enough, this was something i really wanted to add into my game and this works like a charm!
Great! You're welcome.

Original thread: https://forums.rpgmakerweb.com/threads/show-image-in-item-menu.172883/