Draw Circle on Gui Unity
| |
| | | | | | | | |
We strive to provide all our services for free and not interrupt your visit with intrusive advertisements or restrictions - support us by disabling your ad blocker or whitelisting our site.
| |||||||
| Thread Tools |
| [Unity] Drawing Lines,Boxes,Circles |
| | #ane | |||||||||||
| � Forum Moderator � Join Date: May 2014 Location: It's Relative Posts: 946 Reputation: 36726 Points: 102,786, Level: 46
Level up: 38%, three,014 Points needed
Activity: iv.9%
| [Unity] Drawing Lines,Boxes,Circles started working with unity, just unproblematic mono injecting have had no issues so far. Desire to draw shapes just havent had whatsoever success. Nigh methods ive seen have y'all create a texture the just repeat it. more than recently tried this https://www.unknowncheats.me/forum/1247439-post1.html and it did draw the box however it was grayness even when setting the "color.png" to just a red prototype __________________ Discord: Glutinous#2971 | |||||||||||
| | |
| | #ii | |||||||||||
| A God Join Date: Jul 2014 Location: Canada Posts: 197 Reputation: 823 Points: 6,692, Level: ix
Level upwardly: 18%, 908 Points needed
Activeness: 6.nine%
| Quote: Originally Posted by gummy8unny started working with unity, just uncomplicated mono injecting have had no issues so far. Want to depict shapes only havent had any success. Most methods ive seen accept yous create a texture the only echo information technology. more than recently tried this https://www.unknowncheats.me/forum/1247439-post1.html and it did draw the box notwithstanding it was gray even when setting the "colour.png" to just a red image Are you drawing in OnGUI()? | |||||||||||
| | |
| | #3 | |||||||||||
| � Forum Moderator � Join Date: May 2014 Location: It'south Relative Posts: 946 Reputation: 36726 Points: 102,786, Level: 46
Level up: 38%, 3,014 Points needed
Activity: 4.9%
| Quote: Originally Posted past SirMrPoopington Are you cartoon in OnGUI()? Yea, and other GUI functions work similar characterization or box __________________ Discord: Gummy#2971 | |||||||||||
| | |
| | #4 | |||||||||||
| A God Bring together Engagement: Jul 2014 Location: Canada Posts: 197 Reputation: 823 Points: 6,692, Level: 9
Level up: eighteen%, 908 Points needed
Activity: half dozen.9%
| Quote: Originally Posted by gummy8unny Yea, and other GUI functions piece of work like label or box Lawmaking: public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Color color, int thickness) { if (GuiHelper._coloredLineTexture == cipher || GuiHelper._coloredLineColor != color) { GuiHelper._coloredLineColor = color; GuiHelper._coloredLineTexture = new Texture2D(1, 1); GuiHelper._coloredLineTexture.SetPixel(0, 0, GuiHelper._coloredLineColor); GuiHelper._coloredLineTexture.set_wrapMode(0); GuiHelper._coloredLineTexture.Utilise(); } GuiHelper.DrawLineStretched(lineStart, lineEnd, GuiHelper._coloredLineTexture, thickness); } public static void DrawLineStretched(Vector2 lineStart, Vector2 lineEnd, Texture2D texture, int thickness) { Vector2 vector = lineEnd - lineStart; float num = 57.29578f * Mathf.Atan(vector.y / vector.x); if (vector.x < 0f) { num += 180f; } if (thickness < 1) { thickness = one; } int num2 = (int)Mathf.Ceil((float)(thickness / two)); GUIUtility.RotateAroundPivot(num, lineStart); GUI.DrawTexture(new Rect(lineStart.x, lineStart.y - (bladder)num2, vector.get_magnitude(), (float)thickness), texture); GUIUtility.RotateAroundPivot(-num, lineStart); } public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Texture2D texture) { GuiHelper.DrawLine(lineStart, lineEnd, texture, 1); } public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Texture2D texture, int thickness) { Vector2 vector = lineEnd - lineStart; float num = 57.29578f * Mathf.Atan(vector.y / vector.x); if (vector.x < 0f) { num += 180f; } if (thickness < 1) { thickness = i; } int num2 = (int)Mathf.Ceil((float)(thickness / 2)); Rect rect = new Rect(lineStart.x, lineStart.y - (float)num2, Vector2.Distance(lineStart, lineEnd), (float)thickness); GUIUtility.RotateAroundPivot(num, lineStart); GUI.BeginGroup(rect); int num3 = Mathf.RoundToInt(rect.get_width()); int num4 = Mathf.RoundToInt(rect.get_height()); for (int i = 0; i < num4; i += texture.get_height()) { for (int j = 0; j < num3; j += texture.get_width()) { GUI.DrawTexture(new Rect((float)j, (float)i, (float)texture.get_width(), (float)texture.get_height()), texture); } } GUI.EndGroup(); GUIUtility.RotateAroundPivot(-num, lineStart); } Attempt this to describe lines to form a box | |||||||||||
| | |
| | #five | |||||||||||
| � Forum Moderator � Join Date: May 2014 Location: It'south Relative Posts: 946 Reputation: 36726 Points: 102,786, Level: 46
Level up: 38%, iii,014 Points needed
Activity: 4.ix%
| Quote: Originally Posted by SirMrPoopington Lawmaking: public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Color color, int thickness) { if (GuiHelper._coloredLineTexture == null || GuiHelper._coloredLineColor != color) { GuiHelper._coloredLineColor = color; GuiHelper._coloredLineTexture = new Texture2D(1, 1); GuiHelper._coloredLineTexture.SetPixel(0, 0, GuiHelper._coloredLineColor); GuiHelper._coloredLineTexture.set_wrapMode(0); GuiHelper._coloredLineTexture.Apply(); } GuiHelper.DrawLineStretched(lineStart, lineEnd, GuiHelper._coloredLineTexture, thickness); } public static void DrawLineStretched(Vector2 lineStart, Vector2 lineEnd, Texture2D texture, int thickness) { Vector2 vector = lineEnd - lineStart; float num = 57.29578f * Mathf.Atan(vector.y / vector.x); if (vector.x < 0f) { num += 180f; } if (thickness < 1) { thickness = 1; } int num2 = (int)Mathf.Ceil((float)(thickness / ii)); GUIUtility.RotateAroundPivot(num, lineStart); GUI.DrawTexture(new Rect(lineStart.x, lineStart.y - (float)num2, vector.get_magnitude(), (bladder)thickness), texture); GUIUtility.RotateAroundPivot(-num, lineStart); } public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Texture2D texture) { GuiHelper.DrawLine(lineStart, lineEnd, texture, i); } public static void DrawLine(Vector2 lineStart, Vector2 lineEnd, Texture2D texture, int thickness) { Vector2 vector = lineEnd - lineStart; float num = 57.29578f * Mathf.Atan(vector.y / vector.10); if (vector.ten < 0f) { num += 180f; } if (thickness < 1) { thickness = 1; } int num2 = (int)Mathf.Ceil((bladder)(thickness / 2)); Rect rect = new Rect(lineStart.x, lineStart.y - (float)num2, Vector2.Distance(lineStart, lineEnd), (float)thickness); GUIUtility.RotateAroundPivot(num, lineStart); GUI.BeginGroup(rect); int num3 = Mathf.RoundToInt(rect.get_width()); int num4 = Mathf.RoundToInt(rect.get_height()); for (int i = 0; i < num4; i += texture.get_height()) { for (int j = 0; j < num3; j += texture.get_width()) { GUI.DrawTexture(new Rect((float)j, (bladder)i, (float)texture.get_width(), (float)texture.get_height()), texture); } } GUI.EndGroup(); GUIUtility.RotateAroundPivot(-num, lineStart); } Attempt this to draw lines to form a box you didnt copy all of the code but i institute it anyway, am able to draw lines now rest should be easy to do now. Thanks __________________ Discord: Gummy#2971 | |||||||||||
| | |
| | #6 | |||||||||||
| A God Join Date: Jul 2014 Location: Canada Posts: 197 Reputation: 823 Points: 6,692, Level: 9
Level upwards: 18%, 908 Points needed
Activity: half dozen.9%
| Quote: Originally Posted past gummy8unny you didnt copy all of the code just i plant it anyway, am able to depict lines now residuum should be easy to practise at present. Thanks Yea I forgot to add the variables but glad I could help | |||||||||||
| | |
| | #7 | |||||||||||
| 1337 H4x0!2 Join Appointment: Jul 2016 Location: weeb land Posts: 142 Reputation: 4685 Points: ten,872, Level: 12
Level up: 90%, 128 Points needed
Action: 2.0%
| lol wtf are yall doing merely apply GL.LINES __________________ wake upwardly sheeple | |||||||||||
| | |
| | #8 | |||||||||||
| A God Join Date: Jul 2014 Location: Canada Posts: 197 Reputation: 823 Points: 6,692, Level: 9
Level upward: 18%, 908 Points needed
Activity: 6.9%
| Quote: Originally Posted past zoomy500 lol wtf are yall doing merely use GL.LINES wtf, why is this the starting time time im seeing this. | |||||||||||
| | |
We strive to provide all our services for free and not interrupt your visit with intrusive advertisements or restrictions - support u.s.a. past disabling your ad blocker or whitelisting our site.
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Mail service |
| [Source] Drawing Filled Circles | AyywareHater | Counterstrike Global Offensive | 17 | 15th September 2018 08:32 PM |
| Drawing 3Dimensional lines | AnonParadoxum | Counterstrike Global Offensive | 10 | 21st October 2017 11:11 PM |
| [Question] Drawing screen space lines in DirectX 11 | Hooch | Direct3D | 2 | 4th January 2014 09:35 PM |
| [Coding] Demand some help with filling circles in dx11 | dudeinberlin | Direct3D | 1 | 23rd June 2013 05:26 PM |
| [Tutorial] Drawing Lines with the engine | �lius | Call of Duty: Blackness Ops | ix | 27th Jan 2011 02:58 PM |
| Tags |
success, draw, funstions, called, [aid], box, grayness, setting, color.png, red |
« Previous Thread | Next Thread »
|
|
All times are GMT. The time now is 02:x PM.
| |
no new posts
williamsdidly1943.blogspot.com
Source: https://www.unknowncheats.me/forum/unity/244664-unity-drawing-lines-boxes-circles.html
Similar Threads
0 Response to "Draw Circle on Gui Unity"
Post a Comment