hgiesel / anki_set_randomizer

Create randomized sets and much, much more!
https://hgiesel.github.io/anki-set-randomizer/
MIT License
7 stars 0 forks source link

Occlusion features #37

Open hgiesel opened 5 years ago

hgiesel commented 5 years ago

Having occlusion features would be really neat

Syntax ideas:

$image(i0, '<img>bla</img>')
-- or just
$image(i1, bla)

and then draw images on it:

$yank(i0, rect, x:50, y:50, w:20.3, h:23.5)
-- one after coma position is more than enough
-- or just
$y()
hgiesel commented 5 years ago

I don't need to mark pictures. They mark themselves with an image tag.

This way, having something equivalent to $s() and equivalent to $a() both for svg elements should be enough. $template() should be $s(), and $yank() should be $a()

hgiesel commented 5 years ago

$yank([imageid], yankgroup, x:y:width:height[:radius], [text]) -> text refers to another field like second and third argument in $c, $m, etc., e.g. +0. Value numbers x:y:... mean something else depending on type style attribute. and $template(style, yankgroup) and $style(stylename, ...styleattributes) -> $template shares them with $apply and $rule

hgiesel commented 5 years ago

type:rect, type:ellipse (high radius), type:arrow or type:darrow, for they the values mean x1:y1:x2:y2[:stroke-width] and text is written along the same angle along the arrow.

Another attribute is color, which turns into fill, or stroke accordingly.

hgiesel commented 5 years ago

Specific highlights are only: [[$t(i1, color:red, display:true)]] or [[$t(*, dp:none)::$t(i1, color:red, display:true)]]

hgiesel commented 5 years ago

there should also be a way to rotate en element

EDIT: No way to rotate an element. Instead use a polygon.

hgiesel commented 5 years ago

type can be:

  1. rect rect:x:y:width:[height:rx:ry] // square, if only three values provided
  2. ellipse ellipse:cx:cy:rx:[ry] // circle, if only three values provided
  3. polygon polygon:x1:y1:x2:y2:[x1:y2:...]
  4. line line:x1:y1:x2:y2:[x1:y2:...] // actually polyline (fill should be forced transparent)
  5. arrow arrow:x1:y1:x2:y2:[x1:y2:...] // actually polyline with marker (fill should be forced transparent)
  6. darrow darrow:x1:y1:x2:y2:[x1:y2:...] // actually polyline with marker (fill should be forced transparent)
hgiesel commented 5 years ago

Style attributes include:

  1. fill // color
  2. fill-opacity

  3. stroke // color
  4. stroke-opacity
  5. stroke-width

  6. type (see above)
  7. display (some of them should apply, like none)