forked from halo-battle/game
Version 1.9g
This commit is contained in:
parent
d028822d0b
commit
4c9814a99c
800 changed files with 237325 additions and 1949 deletions
69
artichow/examples/test/error-box.php
Normal file
69
artichow/examples/test/error-box.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
require_once "../../Graph.class.php";
|
||||
|
||||
|
||||
$message = "Missing imageantialias() function.\nCheck your PHP installation.";
|
||||
|
||||
|
||||
$message = wordwrap($message, 48, "\n", TRUE);
|
||||
|
||||
$width = 400;
|
||||
$height = max(90, 50 + 13 * (substr_count($message, "\n") + 1));
|
||||
|
||||
$graph = new Graph($width, $height);
|
||||
|
||||
$driver = $graph->getDriver();
|
||||
|
||||
// Display title
|
||||
$driver->filledRectangle(
|
||||
new White,
|
||||
new Line(
|
||||
new Point(0, 0),
|
||||
new Point($width, $height)
|
||||
)
|
||||
);
|
||||
|
||||
$driver->filledRectangle(
|
||||
new Red,
|
||||
new Line(
|
||||
new Point(0, 0),
|
||||
new Point(110, 25)
|
||||
)
|
||||
);
|
||||
|
||||
$text = new Text(
|
||||
"Artichow error",
|
||||
new Font3,
|
||||
new White,
|
||||
0
|
||||
);
|
||||
|
||||
$driver->string($text, new Point(5, 6));
|
||||
|
||||
// Display red box
|
||||
$driver->rectangle(
|
||||
new Red,
|
||||
new Line(
|
||||
new Point(0, 25),
|
||||
new Point($width - 90, $height - 1)
|
||||
)
|
||||
);
|
||||
|
||||
// Display error image
|
||||
$image = new FileImage('error.png');
|
||||
$driver->copyImage($image, new Point($width - 81, $height - 81), new Point($width - 1, $height - 1));
|
||||
|
||||
// Draw message
|
||||
$text = new Text(
|
||||
$message,
|
||||
new Font2,
|
||||
new Black,
|
||||
0
|
||||
);
|
||||
|
||||
$driver->string($text, new Point(10, 40));
|
||||
|
||||
$graph->draw();
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue