|
These two new GUI Objects are a bit like ImageLabels in that they store an image, however they store an image that is drawn onto them by scripts.
The canvas starts out blank (all pixels transparent) and the player can use the following methods to draw onto it (pixelData is a hex in the form RGBA IE: "FF00FF00" is purple with 0 transparency. If blending is false then the pixel is overridden, regardless of the alpha.):
DrawPixel(Vector2 point, String pixelData, bool blending = true)
DrawLine(Vector2 point1, Vector2 point2, String pixelData, bool blending = true)
DrawRectangle(Vector2 point1, Vector2 point2, String pixelData, bool blending = true)
DrawRectangle(table points, String pixelData, bool blending = true) --points is a table of Vector2s.
DrawCircle(Vector2 center, int radius, String pixelData, bool blending = true)
DrawDecal(Vector2 topLeft, int assetId, bool blending = true)
DrawImage(Vector2 topLeft, table pixelData, bool blending = true) --IE: {{"FFFFFF00", "FFFFFF00"}, {"FF00FF00", "00000000"}}. If all rows are not of equal length, it will error.
ClearCanvas()
There will be a Vector2 property saying how many pixels wide and tall the canvas is, the same as SurfaceGuis.
"But this is abusable!" - So are frames.
"Why have DrawImage if we have DrawDecal?" - So that we can draw recolored versions of images on the screen or get images using HttpService. |
|
|
Oops, that second DrawRectangle should be DrawPolygon.
And maybe DrawRectangle, DrawDecal and DrawImage could have a rotation property. |
|
|
|
spacegangJoin Date: 2011-07-03 Post Count: 3863 |
so it is like putting an image inside of an image
so instead of instance'd a new image, you can just change the values?
surport 100% |
|
|
|
Stupid Report Abuse button right next to the Reply button... Why can I even report myself, anyway? |
|
MunimRJoin Date: 2011-06-26 Post Count: 1538 |
Oh my god a decent idea on S&I
THE WORLD IS COMING TO AN END
Anyways, yea I like the idea. Support
[WORK WITH ME PEOPLE] |
|
jjkl44Join Date: 2009-09-11 Post Count: 732 |
I support.
~~Necromancer! --Eucliwood Hellscythe~~ |
|
|
Alternative idea, what if we could use OpenGL on it?
IE:
CanvasLabel/CanvasButton:glClear("GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT")
CanvasLabel/CanvasButton:glBindTexture("GL_QUADS")
CanvasLabel/CanvasButton:glBegin("GL_QUADS")
CanvasLabel/CanvasButton:glVertex2f(0.2, 0.2)
CanvasLabel/CanvasButton:glVertex2f(0.3, 0.2)
CanvasLabel/CanvasButton:glVertex2f(0.3, 0.3)
CanvasLabel/CanvasButton:glVertex2f(0.2, 0.3)
CanvasLabel/CanvasButton:glEnd(0.2, 0.2) |
|
AX94Join Date: 2011-08-09 Post Count: 7390 |
OpenGL looks a bit complicated. The first idea seems easier to read for me. I support this though. |
|
|
It might be a bit more complicated, but it is essentially the same. AND you can bind a texture then draw complex shapes with it (Allowing for you to render meshes with textures on a GUI) |
|
AX94Join Date: 2011-08-09 Post Count: 7390 |
This is literally the best idea I've seen on here in weeks. |
|
|
|
|
|
|
support. not easily scriptable, also. |
|
|
@TutorialBlox: Using thousands of frames does not count. The lag would be so extreme that it is totally impractical. |
|
|
|
|
|
Sounds great! I don't know if ROBLOX has OpenGL support, though... |
|
dribsonJoin Date: 2010-01-30 Post Count: 13635 |
Support. We need more intuitive additions and less hat |
|
|
@cyber: it uses DirectX and OpenGL, and I am quite sure DirectX contains support for OpenGL. |
|