1
General Discussion / Re: All Tile Shapes
« on: 2018-03-27, 06:57:42 AM »
Done. Although the topic would probably stay at the top for quite a while even without a pin these days
.

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
public bool IsSpriteVisible(SpriteBase sprite)
{
return sprite.isActive && sprite.GetBounds().IntersectsWith(VisibleArea);
}
public void InjectSprites()
{
for (int i = 0; (i < m_nInjectStartIndex) && (i < m_Sprites.Count); i++)
{
SpriteBase sprite = m_Sprites[i];
if (IsSpriteVisible(sprite))
AppendFrames(sprite.PixelX, sprite.PixelY, sprite.GetCurrentFramesetFrames(), sprite.color, -1);
}
for (int i = m_nInjectStartIndex; (i < m_nAppendStartIndex) && (i < m_Sprites.Count); i++)
{
SpriteBase sprite = m_Sprites[i];
if (IsSpriteVisible(sprite))
InjectFrames(sprite.PixelX, sprite.PixelY, sprite.GetCurrentFramesetFrames(), sprite.color);
}
for (int i = m_nAppendStartIndex; (i < m_Sprites.Count); i++)
{
SpriteBase sprite = m_Sprites[i];
if (IsSpriteVisible(sprite))
AppendFrames(sprite.PixelX, sprite.PixelY, sprite.GetCurrentFramesetFrames(), sprite.color, 1);
}
}
The game seems a tad slower overall (With the added scope lookup time) but each frame seems to be less variable in timing. I'd much rather have a slower speed overall than a fast but insanely variable speed, especially when I have more being drawn on screen.
Is this code also drawing sprites which aren't on screen?
Maybe some browsers are smart enough to know that something is being drawn offscreen but is this something I can always rely on?
3. One idea for real time color modulation I had was to possibly copy the graphic onto an offscreen canvas, use FillRect a few times with different gCO modes, then copy back to the game canvas. Please let me know what you think, I don't understand these very well:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
I've played around with these, and gotten all of them to work, and I know that there's SOME combination which can be used for color modulation. I'm not sure which though. You probably can find out..
So far I've done fast color tinting, desaturation, brightening, darkening (burn), and light bloom.
5. I would never say that SGDK2 isn't ready for hardcore game development. It's all about HOW ITS USED.
Everything in your engine is perfect.
Perfect.
...
Please never stop working on SGDK2,
Another thing I've mentioned earlier was a framerate issue...
...
Version 2.3 should probably use refreshAnimationFrame() rather than setInterval/setTimeout.
Finally, you should consider adding more exporters than the HTML5 exporter. An HTML5 project can be exported across multiple devices through the use of tools such as ionic and phonegap.
<img id="CoolFont" style="display:none" src="CoolFont.png" />
<img id="FireFont" style="display:none" src="FireFont.png" />
<img id="Lettering" style="display:none" src="Lettering.png" />
<img id="SHFL32x32" style="display:none" src="SHFL32x32.png" />
<img id="SHFLPlatform" style="display:none" src="SHFLPlatform.png" />
<img id="SHFLSprites" style="display:none" src="SHFLSprites.png" />
<img id="CoolFont" style="display:none" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAABICAYAAABiKukfAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
...
GNkrX2VeTJAPAKoWmeL6TluKvyNTDzn1a+Lh7zkM/A/wbs0ciKuS5wAAAABJRU5ErkJggg==" />
<img id="FireFont" style="display:none" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAABICAYAAABiKukfAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
...
var result = new Array();
with this in decodeData1:var buf = new ArrayBuffer(data.length);
var result = new Uint8Array(buf);
and this in decodeData2:var buf = new ArrayBuffer(data.length);
var result = new Uint16Array(buf);