mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 07:20:46 +00:00
FlappyBug: Convert the main game widget to a GUI::Frame
This commit is contained in:
parent
928364e102
commit
25c53e35e7
Notes:
sideshowbarker
2024-07-18 11:38:37 +09:00
Author: https://github.com/trflynn89
Commit: 25c53e35e7
Pull-request: https://github.com/SerenityOS/serenity/pull/8202
2 changed files with 6 additions and 3 deletions
|
@ -53,10 +53,13 @@ void Game::timer_event(Core::TimerEvent&)
|
|||
|
||||
void Game::paint_event(GUI::PaintEvent& event)
|
||||
{
|
||||
GUI::Frame::paint_event(event);
|
||||
|
||||
GUI::Painter painter(*this);
|
||||
painter.add_clip_rect(frame_inner_rect());
|
||||
painter.add_clip_rect(event.rect());
|
||||
|
||||
painter.draw_tiled_bitmap(rect(), *m_background_bitmap);
|
||||
painter.draw_tiled_bitmap(frame_inner_rect(), *m_background_bitmap);
|
||||
|
||||
painter.draw_scaled_bitmap(m_cloud.rect(), *m_cloud.bitmap(), m_cloud.bitmap()->rect(), 0.2f);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue