设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
返回列表
+ 发新帖
查看: 267|回复: 0

[转载发布] Hammy - Window Shadows

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

    连续签到: 1 天

    [LV.7]常住居民III

    9102

    主题

    893

    回帖

    7万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-8-3 15:18:21 | 显示全部楼层 |阅读模式
    Hammy - Window Shadows v1.04
    Add depth and visual polish to your game's UI with customizable window shadows​




    Introduction

    This script provides a customizable shadow system for all windows in RPG Maker VX Ace. It automatically adds shadows behind windows to create depth and visual polish in your game's user interface.

    AI Disclaimer: Generative AI was used to refine the documentation and presentation of this script, as I am not a native English speaker. Additionally, AI was used to optimize the explicit z-index initialization part of the code, for naming conventions in some places and for general beautification of the script.



    Features

    Core Shadow Features

    • Automatic shadow creation for all windows
    • Runtime shadow enable/disable via Game_System integration
    • Window exclusion system for selective shadow application
    • Explicit z-index management for proper shadow layering

    Customization System

    • Per-window-class shadow configuration with custom graphics and settings
    • Per-window-type shadow configuration via FF9 Windowskin System integration
    • Configurable shadow offsets (horizontal and vertical positioning)
    • Shadow opacity scaling based on parent window transparency

    Technical Features

    • Automatic shadow property updates (position, size, openness, visibility)
    • Dynamic shadow recreation when system is re-enabled
    • Proper shadow disposal and cleanup on window termination



    Screenshots







    Script Calls

    The following script calls are available for use in events and other scripts.

    Shadow System Control

    $game_system.window_shadows = true
    Enables the window shadow system globally. All windows will display their configured shadows.

    $game_system.window_shadows = false
    Disables the window shadow system globally. All window shadows will be hidden and disposed.

    Examples
                    Ruby:       



    Usage

    This section explains how to prepare windowskin graphics for use as shadows.

    Shadow Windowskin Preparation
    Shadow windowskins are modified versions of standard RPG Maker VX Ace windowskin files. Windowskins are 128x128 pixels in size.


    • Step 1: Start with your standard windowskin file (128x128 pixels)
    • Step 2: Keep only the upper-right quadrant (x: 64-128, y: 0-64)
    • This section contains the window border graphics. Everything else should be removed or made transparent.
    • Step 3: Remove the top and left border segments
    • Delete the upper portion of the window frame. Delete the left portion of the window frame. Delete the scroll arrows. Keep only the bottom and right border segments.
    • Step 4: The result should show only the lower-right corner and edges
    • This creates the shadow effect when offset behind the main window.
    • Step 5: Place your prepared shadow windowskin files in the Graphics/System
    • Ensure they are referenced properly in the configuration settings.



    Configuration

    Edit the constants in the Hammy::WindowShadows module to configure the shadow windowskins, offsets, opacities, exclusions, and custom window mappings.

    Default Shadow Settings
    Configure the default shadow appearance for all windows in the game. These settings control the shadow windowskin, offsets, and opacity. Set windowskin to nil to disable shadows globally across the game.

    DEFAULT_SETTINGS
    Hash containing default shadow configuration.

    - windowskin: Shadow windowskin filename in Graphics/System folder.
    - offset_x: Horizontal shadow offset in pixels (positive = right).
    - offset_y: Vertical shadow offset in pixels (positive = down).
    - opacity: Shadow opacity value (0-255, where 255 is fully opaque).

    - Valid values: Hash with Symbol keys and specific value types
    - Default:{ :windowskin => "Window_Shadow", :offset_x => 3, ... }

    Example
                    Ruby:       

    Excluded Windows
    Configure window classes that should not display shadows. Add window class constants to exclude specific windows from the shadow system entirely.

    EXCLUDED_WINDOWS
    Array of window class constants to exclude.
    - Valid values: Array containing Window Class constants
    - Default:[Window_BattleLog]

    Example
                    Ruby:       

    Explicit Z-Index Windows
    Configure window classes requiring explicit z-index assignment during initialization. Windows without explicit z-values can cause shadows to appear above other parent windows when shadows are re-enabled.

    EXPLICIT_Z_WINDOWS
    Array of window classes requiring explicit z.

    These windows will be assigned z = 200 during initialization.

    - Valid values: Array containing Window Class constants
    - Default:[Window_ChoiceList]

    Example
                    Ruby:       

    Window Class Shadow Configuration
    Configure custom shadow settings for specific window classes. This allows you to override default shadow appearances for individual window types with per-class customization of graphics and offsets.

    WINDOWSKIN_MAP
    Hash mapping window class names to custom settings.

    - Format: "ClassName" => { :windowskin => "Name", :offset_x => x, :offset_y => y, :opacity => o }

    - Valid values: Hash with String keys and Hash values
    - Default:{ "Window_MenuCommand" => {...}, "Window_Gold" => {...} }

    Example
                    Ruby:       

    Window Type Shadow Map
    Configure custom shadow settings for window types when using the Hammy FF9 Windowskin System. This allows shadows to automatically match the visual style of window types defined in the system.

    WINDOW_TYPE_MAP
    Hash mapping window types to custom shadow settings.

    - Format: :window_type => { :windowskin => "Name", :offset_x => x, :offset_y => y, :opacity => o }
    - Available types: :default, :frame, :topbar, :help

    - Valid values: Hash with Symbol keys and Hash values
    - Default:{ :default => { ... }, :frame => { ... }, ... }

    Example
                    Ruby:       



    Installation


    • Copy the script to an open slot below ▼ Materials but above ▼ Main
    • If using Hammy FF9 Windowskin System, place this script BELOW the Windowskin System script
    • Ensure your shadow windowskin graphics are saved in Graphics/System with the names defined in the configuration



    Compatibility

    This script is made strictly for RPG Maker VX Ace. It is highly unlikely that it will run with RPG Maker VX without adjusting.



    License

    MIT License - Free for commercial and non-commercial use.



    Credits

    No credits are required.



    Why VX Ace?

    You might wonder why I'm still making scripts for VX Ace instead of MV/MZ. The answer is simple: Ruby is pure beauty, while JavaScript is a terrible language. Ruby's elegant syntax, intuitive design, and expressive power make scripting a joy. JavaScript, on the other hand, is a chaotic mess of inconsistencies and quirks that I simply despise.

    I work with RPG Maker VX Ace for my own game project, and I share the scripts I create with the community. If you're still using VX Ace, you're in good company!



    Download

    Script:Download from GitHub
    Demo:Download from GitHub



    YEA System Options Addon

    This addon extends Yanfly's System Options script to include window shadow enable/disable functionality directly in the system options menu. Players can toggle window shadows on and off without using script calls.

    Features:

    • Window shadows toggle command in System Options menu
    • Automatic detection of Global System Option script presence
    • Configurable command insertion position via anchor system

    Requirements:

    Installation: Place this addon script BELOW both YEA-SystemOptions and the Window Shadows System.

    Download:Download from GitHub

    Spoiler: Addon Code
                    Ruby:       






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

    本帖子中包含更多资源

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

    x

    帖子地址: 

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-10-21 20:16 , Processed in 0.088829 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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