273 |
putThings() |
putThings() |
274 |
checkAvgColor(10, 10, 80, 80, (255, 0, 0), delta=50) |
checkAvgColor(10, 10, 80, 80, (255, 0, 0), delta=50) |
275 |
|
|
|
def testTextVob(): |
|
|
from gzz.client import GraphicsAPI |
|
|
from java.awt import Font |
|
|
style = GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10) |
|
|
|
|
|
size = vs.getSize() |
|
|
def putThings(): |
|
|
vs.map.clear() |
|
|
vs.map.put(gzz.vob.vobs.SolidBgVob(Color.red)) |
|
|
vs.map.put(textvob, cs_text) |
|
|
render(vs) |
|
|
textvob = gzz.vob.vobs.TextVob(style, "[XXXXX]") |
|
|
text_size = 50 |
|
|
text_scale = style.getScaleByHeight(text_size) |
|
|
text_width = int(textvob.getWidth(text_scale)) |
|
|
text_height = int(textvob.getHeight(text_scale)) |
|
|
|
|
|
cs = c.orthoBox(0, 0, 100, 100, 1, 1, size.width, size.height) |
|
|
cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size) |
|
|
putThings() |
|
|
checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0), delta=5) |
|
|
|
|
|
cs = c.ortho(0, 0, 100, 100, size.width, size.height) |
|
|
cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size) |
|
|
putThings() |
|
|
checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0), delta=5) |
|
|
|
|
|
cs = c.affineCoordsys(0, 0, 100, 100, size.width, 0, 0, size.height) |
|
|
cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size) |
|
|
putThings() |
|
|
checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0), delta=5) |
|
|
|
|
|
|
|
276 |
# : vim: set syntax=python : |
# : vim: set syntax=python : |