Auto-opacity of the picture.

I have an option in my project to show the character on side of the screen.
And this picture is blocking a view on the area behind it when you are getting close to the line and camera stops moving.
Anybody knows smart solution how to make picture disappear or become transparent when you are walking near borderline of the map ?
you could tie the refresh and/or the position of the picture to the value returned by Game_CharacterBase.isNearTheScreen(), which handles the scrolling of the map.
It's very smart solution for me. I can understand what is going on in the js code, but I don't know how to use it.
NitrdCN.jpg

that's the *structure* you'd want
make sure you replace the short names with the proper *code* and *syntax*

I realized .isNearTheScreen() wouldn't help on taking the picture's size into account.
you have to take the picture's size into account, to calculate the picture's X, which is what you need to trigger the change.

Original thread: https://forums.rpgmakerweb.com/threads/auto-opacity-of-the-picture.95182/