tsenya
→ applyMatrix()Applies six numbers that describe a transformation, in one go.
tsenya(a, b, c, d, e, f)sutisa, dikolosa and godisa all do one job underneath: they multiply every point on the canvas by a table of numbers. That table is called a matrix in English — no Setswana word is used in its place, so Bopa names this function after what it does: it puts the numbers in.
The six numbers are a, b, c, d, e, f, and they do this:
aanddscale sideways and vertically —tsenya(2, 0, 0, 2, 0, 0)is the same asgodisa(2).eandfmove —tsenya(1, 0, 0, 1, 50, 20)is the same assutisa(50, 20).bandcslant.
You will rarely need this: sutisa, dikolosa and godisa are easier to read and do the same things. It is here so you can apply several transformations at once.
Like every other transformation it accumulates, and is reset at the start of tshwantsha. Use simololaGape to wipe them all.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
a | palo | Scale sideways. |
b | palo | Slant vertically. |
c | palo | Slant sideways. |
d | palo | Scale vertically. |
e | palo | Move sideways. |
f | palo | Move vertically. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(238);
tlogelaMothalo();
// ka sutisa le godisa
baya();
sutisa(110, 200);
godisa(1.5);
tlatsaMmala(220, 120, 110);
thalaSekwere(-40, -40, 80);
tsaya();
// ka dipalo tse thataro — popego e e tshwanang tota
baya();
tsenya(1.5, 0, 0, 1.5, 290, 200);
tlatsaMmala(110, 170, 220);
thalaSekwere(-40, -40, 80);
tsaya();
}