Window system

in ita •  2 days ago 

class ProgramWindow{

public $x;
public $y;
public $width;
public $height;

function __construct(){
    $this->x = 0;
    $this->y = 0;
    $this->width = 800;
    $this->height = 600;
}

function resize($size){
    $this->width = $size->width;
    $this->height = $size->height;
}

function move($position){
    $this->x = $position->x;
    $this->y = $position->y;
}

}

<?php

class Size{

public $width;
public $height;

function __construct($height,$width){
    $this->width = $width;
    $this->height = $height;
}

}

<?php

class Position{

public $x;
public $y;

function __construct($y,$x){
    $this->y = $y;
    $this->x = $x;
}

}

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!