FML 1.2
This commit is contained in:
@ -2,15 +2,15 @@
|
||||
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
// Warning: The mood class isn't fully supported yet!
|
||||
// Missing attributes: LDir1..
|
||||
// Warning: The mood class isn't fully supported yet!
|
||||
// Missing attributes: LDir1..
|
||||
|
||||
/**
|
||||
* Class representing a Stylesheets Mood
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Mood {
|
||||
/*
|
||||
@ -51,15 +51,15 @@ class Mood {
|
||||
/**
|
||||
* Set Ambient Color in which the Elements reflect the Light
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightAmbientColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lAmbient_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -67,15 +67,15 @@ class Mood {
|
||||
/**
|
||||
* Set Minimum Value for the Background Color Range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setCloudsColorMin($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->cloudsRgbMinLinear = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -83,15 +83,15 @@ class Mood {
|
||||
/**
|
||||
* Set Maximum Value for the Background Color Range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setCloudsColorMax($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->cloudsRgbMaxLinear = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -99,15 +99,15 @@ class Mood {
|
||||
/**
|
||||
* Set RGB Color of Light Source 0
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0Color($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lDir0_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -119,7 +119,7 @@ class Mood {
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0Intensity($intensity) {
|
||||
$this->lDir0_Intens = (float) $intensity;
|
||||
$this->lDir0_Intens = (float)$intensity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -130,33 +130,33 @@ class Mood {
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0PhiAngle($phiAngle) {
|
||||
$this->lDir0_DirPhi = (float) $phiAngle;
|
||||
$this->lDir0_DirPhi = (float)$phiAngle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Theta-Angle of Light Source 0
|
||||
*
|
||||
*
|
||||
* @param float $thetaAngle Theta-Angle
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0ThetaAngle($thetaAngle) {
|
||||
$this->lDir0_DirTheta = (float) $thetaAngle;
|
||||
$this->lDir0_DirTheta = (float)$thetaAngle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lBall_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -168,7 +168,7 @@ class Mood {
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallIntensity($intensity) {
|
||||
$this->lBall_Intensity = (float) $intensity;
|
||||
$this->lBall_Intensity = (float)$intensity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -179,22 +179,22 @@ class Mood {
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallRadius($radius) {
|
||||
$this->lBall_Radius = (float) $radius;
|
||||
$this->lBall_Radius = (float)$radius;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fog Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setFogColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->fogColorSrgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -202,15 +202,15 @@ class Mood {
|
||||
/**
|
||||
* Set Self Illumination Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setSelfIllumColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->selfIllumColor = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
@ -222,20 +222,20 @@ class Mood {
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setSkyGradientScale($scale) {
|
||||
$this->skyGradientV_Scale = (float) $scale;
|
||||
$this->skyGradientV_Scale = (float)$scale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Key for the SkyGradient
|
||||
*
|
||||
* @param float $x Scale Value
|
||||
* @param float $x Scale Value
|
||||
* @param string $color Gradient Color
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function addSkyGradientKey($x, $color) {
|
||||
$x = (float) $x;
|
||||
$color = (string) $color;
|
||||
$x = (float)$x;
|
||||
$color = (string)$color;
|
||||
$gradientKey = array('x' => $x, 'color' => $color);
|
||||
array_push($this->skyGradientKeys, $gradientKey);
|
||||
return $this;
|
||||
|
@ -5,20 +5,20 @@ namespace FML\Stylesheet;
|
||||
/**
|
||||
* Class representing a specific Style3d
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Style3d {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const MODEL_Box = 'Box';
|
||||
const MODEL_Button = 'Button';
|
||||
const MODEL_Box = 'Box';
|
||||
const MODEL_Button = 'Button';
|
||||
const MODEL_ButtonH = 'ButtonH';
|
||||
const MODEL_Title = 'Title';
|
||||
const MODEL_Window = 'Window';
|
||||
|
||||
const MODEL_Title = 'Title';
|
||||
const MODEL_Window = 'Window';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
@ -64,7 +64,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string) $id;
|
||||
$this->id = (string)$id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setModel($model) {
|
||||
$this->model = (string) $model;
|
||||
$this->model = (string)$model;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setThickness($thickness) {
|
||||
$this->thickness = (float) $thickness;
|
||||
$this->thickness = (float)$thickness;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setColor($color) {
|
||||
$this->color = (string) $color;
|
||||
$this->color = (string)$color;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusColor($focusColor) {
|
||||
$this->focusColor = (string) $focusColor;
|
||||
$this->focusColor = (string)$focusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setLightColor($lightColor) {
|
||||
$this->lightColor = (string) $lightColor;
|
||||
$this->lightColor = (string)$lightColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusLightColor($focusLightColor) {
|
||||
$this->focusLightColor = (string) $focusLightColor;
|
||||
$this->focusLightColor = (string)$focusLightColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setYOffset($yOffset) {
|
||||
$this->yOffset = (float) $yOffset;
|
||||
$this->yOffset = (float)$yOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusYOffset($focusYOffset) {
|
||||
$this->focusYOffset = (float) $focusYOffset;
|
||||
$this->focusYOffset = (float)$focusYOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setZOffset($zOffset) {
|
||||
$this->zOffset = (float) $zOffset;
|
||||
$this->zOffset = (float)$zOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ class Style3d {
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusZOffset($focusZOffset) {
|
||||
$this->focusZOffset = (float) $focusZOffset;
|
||||
$this->focusZOffset = (float)$focusZOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@ namespace FML\Stylesheet;
|
||||
/**
|
||||
* Class representing the ManiaLinks Stylesheet
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Stylesheet {
|
||||
/*
|
||||
@ -15,6 +15,7 @@ class Stylesheet {
|
||||
*/
|
||||
protected $tagName = 'stylesheet';
|
||||
protected $styles3d = array();
|
||||
/** @var Mood $mood */
|
||||
protected $mood = null;
|
||||
|
||||
/**
|
||||
@ -92,6 +93,7 @@ class Stylesheet {
|
||||
$stylesXml = $domDocument->createElement('frame3dstyles');
|
||||
$stylesheetXml->appendChild($stylesXml);
|
||||
foreach ($this->styles3d as $style3d) {
|
||||
/** @var Style3d $style3d */
|
||||
$style3dXml = $style3d->render($domDocument);
|
||||
$stylesXml->appendChild($style3dXml);
|
||||
}
|
||||
|
Reference in New Issue
Block a user