<?php
require dirname(__DIR__) . '/vendor/autoload.php';
use Kingbes\Raylib\Core;
use Kingbes\Raylib\Text;
use Kingbes\Raylib\Utils;
use Kingbes\Raylib\Shapes;
$screenWidth = 800;
$screenHeight = 450;
Core::initWindow($screenWidth, $screenHeight, "input mouse wheel");
$boxPositionY = $screenHeight / 2 - 40;
$scrollSpeed = 4;
Core::setTargetFPS(60);
$white = Utils::Color(255, 255, 255);
$green = Utils::Color(0, 255, 0);
$gray = Utils::Color(200, 200, 200);
$lightGray = Utils::Color(220, 220, 220);
while (!Core::windowShouldClose()) {
$boxPositionY -= Core::getMouseWheelMove() * $scrollSpeed;
Core::beginDrawing();
Core::clearBackground($white);
Shapes::drawRectangle($screenWidth / 2 - 40, $boxPositionY, 80, 80, $green);
Text::drawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, $gray);
Text::drawText("Box position Y: " . $boxPositionY, 10, 40, 20, $lightGray);
Core::endDrawing();
}
Core::closeWindow();