Libraries.Game.Graphics.Fonts.PixelIntersection Documentation
The PixelIntersection class is used to maintain information about pixels of a glyph, including which pixels need to be turned "on" and at what intensity so as to render the glyph accurately.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
// Indicates that the pixel at x-coordinate 0 for a given y-coordinate
// needs to be drawn will full (1) intensity.
pixel:SetIntensity(1)
pixel:SetXPosition(0)
end
end
Inherits from: Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
Compare(Libraries.Language.Object intersection) | This action checks if two PixelIntersections are the same, or if one is greater than the other. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |
GetHashCode() | This action gets the hash code for an object. |
GetIntensity() | This action returns the intensity of the pixel at a given x/y coordinate pair. |
GetXPosition() | This action gets the x-coordinate position of the pixel. |
SetIntensity(number intensity) | This action sets the intensity of the pixel at a given x/y coordinate pair. |
SetXPosition(integer x) | This action sets the x-coordinate position of the pixel. |
ToText() | This action returns the x-coordinate position of the pixel as text. |
Actions Documentation
Compare(Libraries.Language.Object intersection)
This action checks if two PixelIntersections are the same, or if one is greater than the other.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
PixelIntersection pixel2
integer result = pixel:Compare(pixel2)
end
end
Parameters
- Libraries.Language.Object: The PixelIntersection to compare against.
Return
integer: Returns whether or not the two PixelIntersections are the same, or if one is greater than the other.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Example Code
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
GetHashCode()
This action gets the hash code for an object.
Example Code
Object o
integer hash = o:GetHashCode()
Return
integer: The integer hash code of the object.
GetIntensity()
This action returns the intensity of the pixel at a given x/y coordinate pair.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
output pixel:GetIntensity()
end
end
Return
number: Returns the intensity of the pixel at a given x/y coordinate pair.
GetXPosition()
This action gets the x-coordinate position of the pixel.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
output pixel:GetXPosition()
end
end
Return
integer: Returns the x-coordinate position of the pixel.
SetIntensity(number intensity)
This action sets the intensity of the pixel at a given x/y coordinate pair.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
pixel:SetIntensity(0.5)
end
end
Parameters
- number intensity: The intensity of the pixel at a given x/y coordinate pair.
SetXPosition(integer x)
This action sets the x-coordinate position of the pixel.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
pixel:SetXPosition(0)
end
end
Parameters
- integer x: The x-coordinate position of the pixel.
ToText()
This action returns the x-coordinate position of the pixel as text.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
PixelIntersection pixel
output pixel:ToText()
end
end
Return
text: Returns the x-coordinate position of the pixel as text.