Adding initial cairo printing of forest box to the pokemon editor.
This commit is contained in:
parent
3ab70cefe5
commit
3ace9d4438
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "pokeemerald"]
|
||||||
|
path = pokeemerald
|
||||||
|
url = https://github.com/pret/pokeemerald
|
|
@ -325,15 +325,25 @@ sub activate_about {
|
||||||
sub activate_view_pc {
|
sub activate_view_pc {
|
||||||
my $gtk_window = Gtk4::Window->new;
|
my $gtk_window = Gtk4::Window->new;
|
||||||
my $canvas = Gtk4::DrawingArea->new;
|
my $canvas = Gtk4::DrawingArea->new;
|
||||||
|
$gtk_window->set_default_size(312,340);
|
||||||
|
$gtk_window->set_resizable(0);
|
||||||
$canvas->set_draw_func(sub {
|
$canvas->set_draw_func(sub {
|
||||||
my $canvas = shift;
|
my $canvas = shift;
|
||||||
my $cairo = shift;
|
my $cairo = shift;
|
||||||
my $width = shift;
|
my $width = shift;
|
||||||
my $height = shift;
|
my $height = shift;
|
||||||
print Data::Dumper::Dumper \%Cairo::;
|
my $root = path(__FILE__)->parent->parent->parent->parent;
|
||||||
|
|
||||||
$cairo->rectangle(0, 0, $width, $height);
|
$cairo->rectangle(0, 0, $width, $height);
|
||||||
$cairo->set_source_rgb(255, 0, 0);
|
my $surface = Cairo::ImageSurface->create_from_png($root->child('resources/forest.png'));
|
||||||
$cairo->fill;
|
|
||||||
|
$cairo->set_source_rgb(0, 0, 0);
|
||||||
|
$cairo->paint;
|
||||||
|
$cairo->scale(2, 2);
|
||||||
|
$cairo->set_source_surface($surface, 0, 0);
|
||||||
|
$cairo->get_source()->set_filter('nearest');
|
||||||
|
|
||||||
|
$cairo->paint;
|
||||||
});
|
});
|
||||||
$gtk_window->set_child($canvas);
|
$gtk_window->set_child($canvas);
|
||||||
$gtk_window->present;
|
$gtk_window->present;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 954ba0a15590d1eaf4929238cec4e0ea3d2e8dd4
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Loading…
Reference in New Issue