![]() The game is freeware, and is still under development with updates. Toribash was a "Best Game Idea" finalist at the 2006 Swedish Game Awards. That’s it from this tutorial, thanks for reading.Toribash is a turn-based 3d 3rd person tactical martial arts fightning game using physics based attacks, created by Hampus Söderström, a Swedish software developer. Now to draw using those we can go: function draw3dfunc() This will set x, y and z to the x, y and z coordinates of the neck joint of tori: get_joint_pos(player, joint). Now if we want to draw a sphere onto the head of our tori we need to first get the position of our head, we can do this by using: x, y, z = get_joint_pos(0, 0) To draw a sphere in 3d we need to use: draw_sphere(x,y,z,radius) To draw in 3D we will be needing a draw3d hook. This determines the Y coordinate of the text, it is the line number (i) multiplied by the line spacing, take away the line spacing (so the first line would be at 0 not 17) and then added onto the y co ordinate of the quad we drew earlier. It gets the number of lines and multiplies it by the line spacing which in this case is 17.5 because it is what I think looks the best with the font. This determines what size (height wise) what the quad should be. This makes ScreenWidth the width of the window that toribash is displayed in and ScreenHeight the height of the window that toribash is displayed in. This defines where the text will be displayed in the y axis, in this case 200px down from the top of the window. This defines the text that we want to display. ScreenWidth, ScreenHeight = get_window_size()ĭraw_quad(10,placey,ScreenWidth-20,#text*17.5) Lets get a bit more advanced and try adding some text and a dynamically shaped rectangle. This script should draw a rectangle from (10,300) to (110,500). So lets get started by drawing our first rectangle! function draw2dfunc() Example: 100, 300 would be 100px to the right of the top left hand corner and 300px down. ![]() The origin (0,0) is in the top left hand corner, the higher the x value, the more to the right you are drawing, the higher the y value, the more to the bottom of the screen you are drawing. Font is a number from 0-5 that determines what font the text should be drawn in: text = the text to be drawn, x = the x coordinate, y = the y coordinate. This draws a disk at (x,y) with the inner radius of inner, outer radius of outer, the number of slices (3 being a triangle, 4 being a quadrilateral), the number of loops being loops, start angle being start, fill angle being sweep and additive blending being determined by blend. draw_disk(x, y, inner, outer, slices, loops, start, sweep, blend) x = the x coordinate, y = the y coordinate, w = the width, h = the height and texture is an optional extra which I may cover later. (0,0,0,1) would be black, (1,1,1,0.5) would be a semi transparent white colour. r = red, g = green, b = blue and a = alpha (opacity). set_color(r,g,b,a)īefore drawing anything you need to set its colour. OK so this is a draw2d hook, lets look at some basic drawing functions. So lets begin by looking at drawing in two dimensions. To draw in 2d you need to use the draw2d hook, and to draw in 3d you need to use the draw 3d hook. Draw a list of text with a dynamically sized rectangular backgroundĪll drawing in lua is done in hooks.In this tutorial I will be covering how to draw in 2d and 3d space.
0 Comments
Leave a Reply. |