Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F628331
PhutilSprite.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhutilSprite.php
View Options
<?php
/**
* NOTE: This is very new and unstable.
*/
final
class
PhutilSprite
extends
Phobject
{
private
$sourceFiles
=
array
();
private
$sourceX
;
private
$sourceY
;
private
$sourceW
;
private
$sourceH
;
private
$targetCSS
;
private
$spriteSheet
;
private
$name
;
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
public
function
getName
()
{
return
$this
->
name
;
}
public
function
setTargetCSS
(
$target_css
)
{
$this
->
targetCSS
=
$target_css
;
return
$this
;
}
public
function
getTargetCSS
()
{
return
$this
->
targetCSS
;
}
public
function
setSourcePosition
(
$x
,
$y
)
{
$this
->
sourceX
=
$x
;
$this
->
sourceY
=
$y
;
return
$this
;
}
public
function
setSourceSize
(
$w
,
$h
)
{
$this
->
sourceW
=
$w
;
$this
->
sourceH
=
$h
;
return
$this
;
}
public
function
getSourceH
()
{
return
$this
->
sourceH
;
}
public
function
getSourceW
()
{
return
$this
->
sourceW
;
}
public
function
getSourceY
()
{
return
$this
->
sourceY
;
}
public
function
getSourceX
()
{
return
$this
->
sourceX
;
}
public
function
setSourceFile
(
$source_file
,
$scale
=
1
)
{
$this
->
sourceFiles
[
$scale
]
=
$source_file
;
return
$this
;
}
public
function
getSourceFile
(
$scale
)
{
if
(
empty
(
$this
->
sourceFiles
[
$scale
]))
{
throw
new
Exception
(
pht
(
"No source file for scale '%s'!"
,
$scale
));
}
return
$this
->
sourceFiles
[
$scale
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 14, 1:48 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
142167
Default Alt Text
PhutilSprite.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment