Рисуем в ASS
|
|
|
StNekroman | Дата: Воскресенье, 25.04.2010, 23:29 | Сообщение # 2 |
Группа:
Поработитель
Сообщений: 410
Статус: Offline
| Маленькая выноска из мануала, для того, чтобы инфа не было безпредметной: Quote Drawing tags Advanced Substation Alpha also supports some advanced drawing tags that allow you to draw with vectorial graphics. Certain familiarity with vectors and splines will make the understanding of this much simpler. \p<0/1/..> - Toggle drawing mode Setting this tag to 1 or above enables drawing mode. Text after this override block will then be interpreted as drawing instructions, and not as actually visible text. Setting this to zero disables drawing mode, restoring normal behavior. When turning on, the value might be any integer larger than zero, and will be interpreted as the scale, in 2^(value-1) mode. This is done to allow sub-pixel accuracy. e.g.: (Enables drawing with normal coordinates) (Disables drawing) (Enables drawing, and resolution is doubled. So drawing to 200,200 will actually draw to 100,100) (Enables drawing, and resolution is 8x larger (2^(4-1)). So drawing to 400,400 will actually draw to 50,50) \pbo - Baseline offset Defines baseline offset for drawing. This is basically an Y offset to all coordinates. e.g.: (Draws everything 50 pixels above specified) (Draws everything 100 pixels below specified) Drawing commands These commands should appear either in a \clip tag (vectorial overload) or between \p# and \p0, outside override blocks. For example (taken straight from the ASS specs): Square: Code {\p1}m 0 0 l 100 0 100 100 0 100{\p0} Rounded square: Code {\p1}m 0 0 s 100 0 100 100 0 100 c{\p0} (c equals to "p 0 0 100 0 100 100" in this case) Circle (almost): Code {\p1}m 50 0 b 100 0 100 100 50 100 b 0 100 0 0 50 0{\p0} (note that the 2nd 'b' is optional here) Drawing commands use the primary color for fill and outline color for borders. They also display shadow. The idea of drawing vectors is that there is an invisible "cursor" (think of it as the mouse pointer in a drawing program, or as a pen moving through the image) on the video frame, and you tell it to move to other positions. As it moves, it draws on the area behind it, and when you close the line formed, it fills it with the primary color. m - Move Moves the cursor to x,y. If you have an unclosed shape, it will automatically be closed, as the program assumes that you are now drawing a new, independent shape. All drawing routines must start with this command. n - Move (no closing) Moves the cursor to x,y, without closing the current shape. l - Line Draws a line from the current cursor position to x,y, and moves the cursor there afterwards. b - Cubic Bézier curve Draws a cubic (3rd degree) Bézier curve from the cursor position to (x3,y3), using (x1,y1) and (x2,y2) as the control points. Check the article on Wikipedia for more information about Bézier curves. In this picture taken from that article, P0 is the cursor position, P1 is x1,y1, P2 is x2,y2 and P3 is x3,y3: Note that the curve begins at P0, heads towards P1, then arrives at P3 coming from P2's direction. s .. - Cubic b-spline Draws a cubic (3rd degree) uniform b-spline to point N. This must contain at least 3 coordinates (and is, in that case, the same as b). This basically lets you chain several cubic Bézier curves together. Check this other article on Wikipedia for more information. p - Extend b-spline Extends the b-spline to x,y. This is essentially the same as adding another pair of coordinates at the end of s. c - Close b-spline Closes the b-spline.
Самый БыдлоНутый Переводчик на Планете.
|
|
| |
|
|
|
|
|
|
|
|