设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 89|回复: 0

[制作教程] Hiding and Showing Rooms with Overlay Mapping

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4467

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22941
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28302

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Overlay mapping is a mapping technique where you "overlay" your map with other graphics to create multi-layered maps. Maps are typically decomposed into several different layers depending on their height with respect to objects on the map. For example, you might have a layer for the floor which the player and other characters stand on, and a ceiling, which will appear above the characters.


    This article discusses how you can use "overlay mapping" to achieve a visual effect where the contents of a room are hidden until you have stepped into the room itself.


    Overview


    Suppose we walk into an Inn, and all we see is the lobby and the hallway. All of the rooms are currently hidden.





    After we have checked in, we go ahead and explore the rooms. Upon entering one of the rooms, the contents are revealed!





    You may already have an idea how this might be implemented. I will show you how this can be done using only pictures that you can draw yourself using any image editor such as Photoshop, along with a support script.


    Here's a video showing what we want to achieve:




    Starting with the Map


    The easiest way to do overlay mapping is to have a copy of your map in your image editor. There are many ways to take a picture of your map. One way is to use the Map Screenshot script. So I start by taking a picture of the map that I want to work with:





    Drawing the Covers


    You can see that there is nothing special about the map. There are no black tiles covering each room. I would like to have a black cover over the room, so I go and create a rectangle that will fit the size of the room:





    Very simple picture: just a black rectangle. If you place this over one of the rooms, it should cover it up completely.


    Setting up your Pictures


    We have one black cover, and we want to cover each of the three rooms. We will need to figure out where the picture should be positioned.


    We go back to the RM editor and look at our map. The three squares I've drawn are the spots where the upper-left corner of each of the pictures should be positioned





    Highlighting the square whose upper-left corner is that point in the editor, it will tell me the location of that position in tile coordinates.





    Doing the same for the other two squares, I have (14, 3) and (19, 3). These will be used when I'm actually displaying the picture in the game.


    Displaying a Picture on the Map


    Now, we want to display our covers at the coordinates we have identified from above. One problem with the default engine is that pictures are "anchored" to the game screen, and the game screen by default follows the player around. This means that the picture will follow you around, rather than sticking to our specified coordinate.


    If you have ever worked with pictures in RPG Maker, you will know what I'm talking about. If not, try it out.


    To solve this problem, we introduce a script called "Picture Anchors". As the name suggests, it allows us to customize the picture's anchor. Instead of anchoring to the screen, we want to anchor it to the map.


    Read the rest at HimeWorks!


    本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/hiding-and-showing-rooms-with-overlay-mapping.34258/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 17:40 , Processed in 0.103537 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表