Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当鼠标移过它时,我想制作一个带有悬停效果的框(使框的边框变粗)。我应该在 Gosu 库中使用什么方法?
#green rectangle that I want to give a hover effect (to become bold border) def draw Gosu.draw_rect(50, 50, 100, 50, Gosu::Color::GREEN, ZOrder::MIDDLE, mode=:default) end
在绘图函数中,使用 if 条件作为鼠标悬停按钮,其中参数是按钮的尺寸,然后在 if 条件内绘制一个稍大的矩形,zorder 居中(确保绿色矩形 zorder 位于顶部)