hla
Junior Member
Posts: 29
|
Post by hla on Jan 18, 2017 11:09:20 GMT -8
|
|
|
Post by tftlcdcyg on Jan 18, 2017 23:47:54 GMT -8
Congratulations hla. In order that the walking-sprite run inside of 800 x 480, you must replace this rutine: void drawSprite(int16_t x, int16_t y, byte handle, byte cell) { GD.SaveContext(); GD.Begin(BITMAPS); GD.ColorRGB(255,255,255); GD.ColorA(255); GD.Vertex2ii(x, y, handle, cell); GD.RestoreContext(); } With this: void drawSprite(int16_t x, int16_t y, byte handle, byte cell) { GD.SaveContext(); GD.Begin(BITMAPS); GD.ColorRGB(255,255,255); GD.ColorA(255); GD.VertexTranslateX(16*x); GD.Vertex2ii(0, y, handle, cell); GD.RestoreContext(); } In order to draw the circles inside 800 x 480, you must replace this routine: void drawRandomCircles(int nr) { GD.SaveContext(); GD.Begin(POINTS); for (int i = 0; i < nr; i++) { GD.PointSize(GD.random(16*50)); GD.ColorRGB(GD.random(256), GD.random(256), GD.random(256)); GD.ColorA(GD.random(256)); GD.Vertex2ii(GD.random(800), GD.random(480)); } GD.RestoreContext(); } With this: void drawRandomCircles(int nr) { GD.SaveContext(); GD.Begin(POINTS); for (int i = 0; i < nr; i++) { GD.PointSize(GD.random(16*50)); GD.ColorRGB(GD.random(256), GD.random(256), GD.random(256)); GD.ColorA(GD.random(256)); GD.Vertex2f(16*GD.random(800), 16*GD.random(480)); } GD.RestoreContext(); } GD3 + Teensy 3.6 + Breakout-20 + FT813 5"
|
|
hla
Junior Member
Posts: 29
|
Post by hla on Jan 19, 2017 0:54:08 GMT -8
Thanks for the feedback ! I put the GD.vertexTranslateX magic inside the vertex2ii function in "my" version of gd2.cpp. So it works in full resolution for me just the way it is in github. It didn't work for you ?
Anyway, it might be that your proposed solution is better. Certainly less code. But it seems to solve the same thing. But maybe I miss something here...
|
|