Text3D.cs 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Text3D.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Gui
  18. {
  19. /// <summary>
  20. /// 3D text component.
  21. /// </summary>
  22. public unsafe partial class Text3D : Drawable
  23. {
  24. unsafe partial void OnText3DCreated ();
  25. [Preserve]
  26. public Text3D (IntPtr handle) : base (handle)
  27. {
  28. OnText3DCreated ();
  29. }
  30. [Preserve]
  31. protected Text3D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnText3DCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Text3D_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Text3D_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Text3D_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Text3D_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Text3D_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Text3D));
  54. return new StringHash (Text3D_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Text3D_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Text3D));
  61. return Marshal.PtrToStringAnsi (Text3D_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public Text3D () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr Text3D_Text3D (IntPtr context);
  69. [Preserve]
  70. public Text3D (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(Text3D));
  73. handle = Text3D_Text3D ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnText3DCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void Text3D_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory. Drawable must be registered first.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(Text3D));
  85. Text3D_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void Text3D_ApplyAttributes (IntPtr handle);
  89. /// <summary>
  90. /// Apply attribute changes that can not be applied immediately.
  91. /// </summary>
  92. public override void ApplyAttributes ()
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. Text3D_ApplyAttributes (handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern UpdateGeometryType Text3D_GetUpdateGeometryType (IntPtr handle);
  99. /// <summary>
  100. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  101. /// </summary>
  102. private UpdateGeometryType GetUpdateGeometryType ()
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. return Text3D_GetUpdateGeometryType (handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool Text3D_SetFont (IntPtr handle, string fontName, float size);
  109. /// <summary>
  110. /// Set font by looking from resource cache by name and font size. Return true if successful.
  111. /// </summary>
  112. public bool SetFont (string fontName, float size)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. return Text3D_SetFont (handle, fontName, size);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern bool Text3D_SetFont0 (IntPtr handle, IntPtr font, float size);
  119. /// <summary>
  120. /// Set font and font size. Return true if successful.
  121. /// </summary>
  122. public bool SetFont (Font font, float size)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. return Text3D_SetFont0 (handle, (object)font == null ? IntPtr.Zero : font.Handle, size);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool Text3D_SetFontSize (IntPtr handle, float size);
  129. /// <summary>
  130. /// Set font size only while retaining the existing font. Return true if successful.
  131. /// </summary>
  132. public bool SetFontSize (float size)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return Text3D_SetFontSize (handle, size);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void Text3D_SetMaterial (IntPtr handle, IntPtr material);
  139. /// <summary>
  140. /// Set material.
  141. /// </summary>
  142. private void SetMaterial (Material material)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. Text3D_SetMaterial (handle, (object)material == null ? IntPtr.Zero : material.Handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void Text3D_SetText (IntPtr handle, string text);
  149. /// <summary>
  150. /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
  151. /// </summary>
  152. private void SetText (string text)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. Text3D_SetText (handle, text);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void Text3D_SetAlignment (IntPtr handle, HorizontalAlignment hAlign, VerticalAlignment vAlign);
  159. /// <summary>
  160. /// Set horizontal and vertical alignment.
  161. /// </summary>
  162. public void SetAlignment (HorizontalAlignment hAlign, VerticalAlignment vAlign)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. Text3D_SetAlignment (handle, hAlign, vAlign);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void Text3D_SetHorizontalAlignment (IntPtr handle, HorizontalAlignment align);
  169. /// <summary>
  170. /// Set horizontal alignment.
  171. /// </summary>
  172. private void SetHorizontalAlignment (HorizontalAlignment align)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. Text3D_SetHorizontalAlignment (handle, align);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void Text3D_SetVerticalAlignment (IntPtr handle, VerticalAlignment align);
  179. /// <summary>
  180. /// Set vertical alignment.
  181. /// </summary>
  182. private void SetVerticalAlignment (VerticalAlignment align)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. Text3D_SetVerticalAlignment (handle, align);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void Text3D_SetTextAlignment (IntPtr handle, HorizontalAlignment align);
  189. /// <summary>
  190. /// Set row alignment.
  191. /// </summary>
  192. private void SetTextAlignment (HorizontalAlignment align)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. Text3D_SetTextAlignment (handle, align);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void Text3D_SetRowSpacing (IntPtr handle, float spacing);
  199. /// <summary>
  200. /// Set row spacing, 1.0 for original font spacing.
  201. /// </summary>
  202. private void SetRowSpacing (float spacing)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. Text3D_SetRowSpacing (handle, spacing);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void Text3D_SetWordwrap (IntPtr handle, bool enable);
  209. /// <summary>
  210. /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
  211. /// </summary>
  212. private void SetWordwrap (bool enable)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. Text3D_SetWordwrap (handle, enable);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void Text3D_SetTextEffect (IntPtr handle, TextEffect textEffect);
  219. /// <summary>
  220. /// Set text effect.
  221. /// </summary>
  222. private void SetTextEffect (TextEffect textEffect)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. Text3D_SetTextEffect (handle, textEffect);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void Text3D_SetEffectShadowOffset (IntPtr handle, ref Urho.IntVector2 offset);
  229. /// <summary>
  230. /// Set shadow offset.
  231. /// </summary>
  232. private void SetEffectShadowOffset (Urho.IntVector2 offset)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. Text3D_SetEffectShadowOffset (handle, ref offset);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void Text3D_SetEffectStrokeThickness (IntPtr handle, int thickness);
  239. /// <summary>
  240. /// Set stroke thickness.
  241. /// </summary>
  242. private void SetEffectStrokeThickness (int thickness)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. Text3D_SetEffectStrokeThickness (handle, thickness);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void Text3D_SetEffectRoundStroke (IntPtr handle, bool roundStroke);
  249. /// <summary>
  250. /// Set stroke rounding. Corners of the font will be rounded off in the stroke so the stroke won't have corners.
  251. /// </summary>
  252. private void SetEffectRoundStroke (bool roundStroke)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. Text3D_SetEffectRoundStroke (handle, roundStroke);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern void Text3D_SetEffectColor (IntPtr handle, ref Urho.Color effectColor);
  259. /// <summary>
  260. /// Set effect color.
  261. /// </summary>
  262. private void SetEffectColor (Urho.Color effectColor)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. Text3D_SetEffectColor (handle, ref effectColor);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void Text3D_SetEffectDepthBias (IntPtr handle, float bias);
  269. /// <summary>
  270. /// Set effect Z bias.
  271. /// </summary>
  272. private void SetEffectDepthBias (float bias)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. Text3D_SetEffectDepthBias (handle, bias);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void Text3D_SetWidth (IntPtr handle, int width);
  279. /// <summary>
  280. /// Set text width. Only has effect in word wrap mode.
  281. /// </summary>
  282. private void SetWidth (int width)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. Text3D_SetWidth (handle, width);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void Text3D_SetColor (IntPtr handle, ref Urho.Color color);
  289. /// <summary>
  290. /// Set color on all corners.
  291. /// </summary>
  292. public void SetColor (Urho.Color color)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. Text3D_SetColor (handle, ref color);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern void Text3D_SetColor1 (IntPtr handle, Corner corner, ref Urho.Color color);
  299. /// <summary>
  300. /// Set color on one corner.
  301. /// </summary>
  302. public void SetColor (Corner corner, Urho.Color color)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. Text3D_SetColor1 (handle, corner, ref color);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern void Text3D_SetOpacity (IntPtr handle, float opacity);
  309. /// <summary>
  310. /// Set opacity.
  311. /// </summary>
  312. private void SetOpacity (float opacity)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. Text3D_SetOpacity (handle, opacity);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern void Text3D_SetFixedScreenSize (IntPtr handle, bool enable);
  319. /// <summary>
  320. /// Set whether text has fixed size on screen (pixel-perfect) regardless of distance to camera. Works best when combined with face camera rotation. Default false.
  321. /// </summary>
  322. private void SetFixedScreenSize (bool enable)
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. Text3D_SetFixedScreenSize (handle, enable);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern void Text3D_SetFaceCameraMode (IntPtr handle, FaceCameraMode mode);
  329. /// <summary>
  330. /// Set how the text should rotate in relation to the camera. Default is to not rotate (FC_NONE.)
  331. /// </summary>
  332. private void SetFaceCameraMode (FaceCameraMode mode)
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. Text3D_SetFaceCameraMode (handle, mode);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern IntPtr Text3D_GetFont (IntPtr handle);
  339. /// <summary>
  340. /// Return font.
  341. /// </summary>
  342. private Font GetFont ()
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. return Runtime.LookupObject<Font> (Text3D_GetFont (handle));
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern float Text3D_GetFontSize (IntPtr handle);
  349. /// <summary>
  350. /// Return font size.
  351. /// </summary>
  352. private float GetFontSize ()
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. return Text3D_GetFontSize (handle);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern IntPtr Text3D_GetMaterial (IntPtr handle);
  359. /// <summary>
  360. /// Return material.
  361. /// </summary>
  362. private Material GetMaterial ()
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. return Runtime.LookupObject<Material> (Text3D_GetMaterial (handle));
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern IntPtr Text3D_GetText (IntPtr handle);
  369. /// <summary>
  370. /// Return text.
  371. /// </summary>
  372. private string GetText ()
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. return Marshal.PtrToStringAnsi (Text3D_GetText (handle));
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern HorizontalAlignment Text3D_GetTextAlignment (IntPtr handle);
  379. /// <summary>
  380. /// Return row alignment.
  381. /// </summary>
  382. private HorizontalAlignment GetTextAlignment ()
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. return Text3D_GetTextAlignment (handle);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern HorizontalAlignment Text3D_GetHorizontalAlignment (IntPtr handle);
  389. /// <summary>
  390. /// Return horizontal alignment.
  391. /// </summary>
  392. private HorizontalAlignment GetHorizontalAlignment ()
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. return Text3D_GetHorizontalAlignment (handle);
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern VerticalAlignment Text3D_GetVerticalAlignment (IntPtr handle);
  399. /// <summary>
  400. /// Return vertical alignment.
  401. /// </summary>
  402. private VerticalAlignment GetVerticalAlignment ()
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. return Text3D_GetVerticalAlignment (handle);
  406. }
  407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  408. internal static extern float Text3D_GetRowSpacing (IntPtr handle);
  409. /// <summary>
  410. /// Return row spacing.
  411. /// </summary>
  412. private float GetRowSpacing ()
  413. {
  414. Runtime.ValidateRefCounted (this);
  415. return Text3D_GetRowSpacing (handle);
  416. }
  417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  418. internal static extern bool Text3D_GetWordwrap (IntPtr handle);
  419. /// <summary>
  420. /// Return wordwrap mode.
  421. /// </summary>
  422. private bool GetWordwrap ()
  423. {
  424. Runtime.ValidateRefCounted (this);
  425. return Text3D_GetWordwrap (handle);
  426. }
  427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  428. internal static extern TextEffect Text3D_GetTextEffect (IntPtr handle);
  429. /// <summary>
  430. /// Return text effect.
  431. /// </summary>
  432. private TextEffect GetTextEffect ()
  433. {
  434. Runtime.ValidateRefCounted (this);
  435. return Text3D_GetTextEffect (handle);
  436. }
  437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  438. internal static extern Urho.IntVector2 Text3D_GetEffectShadowOffset (IntPtr handle);
  439. /// <summary>
  440. /// Return effect shadow offset.
  441. /// </summary>
  442. private Urho.IntVector2 GetEffectShadowOffset ()
  443. {
  444. Runtime.ValidateRefCounted (this);
  445. return Text3D_GetEffectShadowOffset (handle);
  446. }
  447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  448. internal static extern int Text3D_GetEffectStrokeThickness (IntPtr handle);
  449. /// <summary>
  450. /// Return effect stroke thickness.
  451. /// </summary>
  452. private int GetEffectStrokeThickness ()
  453. {
  454. Runtime.ValidateRefCounted (this);
  455. return Text3D_GetEffectStrokeThickness (handle);
  456. }
  457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  458. internal static extern bool Text3D_GetEffectRoundStroke (IntPtr handle);
  459. /// <summary>
  460. /// Return effect round stroke.
  461. /// </summary>
  462. private bool GetEffectRoundStroke ()
  463. {
  464. Runtime.ValidateRefCounted (this);
  465. return Text3D_GetEffectRoundStroke (handle);
  466. }
  467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  468. internal static extern Urho.Color Text3D_GetEffectColor (IntPtr handle);
  469. /// <summary>
  470. /// Return effect color.
  471. /// </summary>
  472. private Urho.Color GetEffectColor ()
  473. {
  474. Runtime.ValidateRefCounted (this);
  475. return Text3D_GetEffectColor (handle);
  476. }
  477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  478. internal static extern float Text3D_GetEffectDepthBias (IntPtr handle);
  479. /// <summary>
  480. /// Return effect depth bias.
  481. /// </summary>
  482. private float GetEffectDepthBias ()
  483. {
  484. Runtime.ValidateRefCounted (this);
  485. return Text3D_GetEffectDepthBias (handle);
  486. }
  487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  488. internal static extern int Text3D_GetWidth (IntPtr handle);
  489. /// <summary>
  490. /// Return text width.
  491. /// </summary>
  492. private int GetWidth ()
  493. {
  494. Runtime.ValidateRefCounted (this);
  495. return Text3D_GetWidth (handle);
  496. }
  497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  498. internal static extern int Text3D_GetHeight (IntPtr handle);
  499. /// <summary>
  500. /// Return text height.
  501. /// </summary>
  502. private int GetHeight ()
  503. {
  504. Runtime.ValidateRefCounted (this);
  505. return Text3D_GetHeight (handle);
  506. }
  507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  508. internal static extern int Text3D_GetRowHeight (IntPtr handle);
  509. /// <summary>
  510. /// Return row height.
  511. /// </summary>
  512. private int GetRowHeight ()
  513. {
  514. Runtime.ValidateRefCounted (this);
  515. return Text3D_GetRowHeight (handle);
  516. }
  517. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  518. internal static extern uint Text3D_GetNumRows (IntPtr handle);
  519. /// <summary>
  520. /// Return number of rows.
  521. /// </summary>
  522. private uint GetNumRows ()
  523. {
  524. Runtime.ValidateRefCounted (this);
  525. return Text3D_GetNumRows (handle);
  526. }
  527. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  528. internal static extern uint Text3D_GetNumChars (IntPtr handle);
  529. /// <summary>
  530. /// Return number of characters.
  531. /// </summary>
  532. private uint GetNumChars ()
  533. {
  534. Runtime.ValidateRefCounted (this);
  535. return Text3D_GetNumChars (handle);
  536. }
  537. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  538. internal static extern int Text3D_GetRowWidth (IntPtr handle, uint index);
  539. /// <summary>
  540. /// Return width of row by index.
  541. /// </summary>
  542. public int GetRowWidth (uint index)
  543. {
  544. Runtime.ValidateRefCounted (this);
  545. return Text3D_GetRowWidth (handle, index);
  546. }
  547. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  548. internal static extern Vector2 Text3D_GetCharPosition (IntPtr handle, uint index);
  549. /// <summary>
  550. /// Return position of character by index relative to the text element origin.
  551. /// </summary>
  552. public Vector2 GetCharPosition (uint index)
  553. {
  554. Runtime.ValidateRefCounted (this);
  555. return Text3D_GetCharPosition (handle, index);
  556. }
  557. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  558. internal static extern Vector2 Text3D_GetCharSize (IntPtr handle, uint index);
  559. /// <summary>
  560. /// Return size of character by index.
  561. /// </summary>
  562. public Vector2 GetCharSize (uint index)
  563. {
  564. Runtime.ValidateRefCounted (this);
  565. return Text3D_GetCharSize (handle, index);
  566. }
  567. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  568. internal static extern Urho.Color Text3D_GetColor (IntPtr handle, Corner corner);
  569. /// <summary>
  570. /// Return corner color.
  571. /// </summary>
  572. public Urho.Color GetColor (Corner corner)
  573. {
  574. Runtime.ValidateRefCounted (this);
  575. return Text3D_GetColor (handle, corner);
  576. }
  577. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  578. internal static extern float Text3D_GetOpacity (IntPtr handle);
  579. /// <summary>
  580. /// Return opacity.
  581. /// </summary>
  582. private float GetOpacity ()
  583. {
  584. Runtime.ValidateRefCounted (this);
  585. return Text3D_GetOpacity (handle);
  586. }
  587. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  588. internal static extern bool Text3D_IsFixedScreenSize (IntPtr handle);
  589. /// <summary>
  590. /// Return whether text has fixed screen size.
  591. /// </summary>
  592. private bool IsFixedScreenSize ()
  593. {
  594. Runtime.ValidateRefCounted (this);
  595. return Text3D_IsFixedScreenSize (handle);
  596. }
  597. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  598. internal static extern FaceCameraMode Text3D_GetFaceCameraMode (IntPtr handle);
  599. /// <summary>
  600. /// Return how the text rotates in relation to the camera.
  601. /// </summary>
  602. private FaceCameraMode GetFaceCameraMode ()
  603. {
  604. Runtime.ValidateRefCounted (this);
  605. return Text3D_GetFaceCameraMode (handle);
  606. }
  607. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  608. internal static extern ResourceRef Text3D_GetFontAttr (IntPtr handle);
  609. /// <summary>
  610. /// Return font attribute.
  611. /// </summary>
  612. private ResourceRef GetFontAttr ()
  613. {
  614. Runtime.ValidateRefCounted (this);
  615. return Text3D_GetFontAttr (handle);
  616. }
  617. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  618. internal static extern ResourceRef Text3D_GetMaterialAttr (IntPtr handle);
  619. /// <summary>
  620. /// Return material attribute.
  621. /// </summary>
  622. private ResourceRef GetMaterialAttr ()
  623. {
  624. Runtime.ValidateRefCounted (this);
  625. return Text3D_GetMaterialAttr (handle);
  626. }
  627. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  628. internal static extern void Text3D_SetTextAttr (IntPtr handle, string value);
  629. /// <summary>
  630. /// Set text attribute.
  631. /// </summary>
  632. public void SetTextAttr (string value)
  633. {
  634. Runtime.ValidateRefCounted (this);
  635. Text3D_SetTextAttr (handle, value);
  636. }
  637. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  638. internal static extern IntPtr Text3D_GetTextAttr (IntPtr handle);
  639. /// <summary>
  640. /// Return text attribute.
  641. /// </summary>
  642. private string GetTextAttr ()
  643. {
  644. Runtime.ValidateRefCounted (this);
  645. return Marshal.PtrToStringAnsi (Text3D_GetTextAttr (handle));
  646. }
  647. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  648. internal static extern Urho.Color Text3D_GetColorAttr (IntPtr handle);
  649. /// <summary>
  650. /// Get color attribute. Uses just the top-left color.
  651. /// </summary>
  652. private Urho.Color GetColorAttr ()
  653. {
  654. Runtime.ValidateRefCounted (this);
  655. return Text3D_GetColorAttr (handle);
  656. }
  657. public override StringHash Type {
  658. get {
  659. return UrhoGetType ();
  660. }
  661. }
  662. public override string TypeName {
  663. get {
  664. return GetTypeName ();
  665. }
  666. }
  667. [Preserve]
  668. public new static StringHash TypeStatic {
  669. get {
  670. return GetTypeStatic ();
  671. }
  672. }
  673. public new static string TypeNameStatic {
  674. get {
  675. return GetTypeNameStatic ();
  676. }
  677. }
  678. /// <summary>
  679. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  680. /// </summary>
  681. public override UpdateGeometryType UpdateGeometryType {
  682. get {
  683. return GetUpdateGeometryType ();
  684. }
  685. }
  686. /// <summary>
  687. /// Return font size.
  688. /// Or
  689. /// Set font size only while retaining the existing font. Return true if successful.
  690. /// </summary>
  691. public float FontSize {
  692. get {
  693. return GetFontSize ();
  694. }
  695. set {
  696. SetFontSize (value);
  697. }
  698. }
  699. /// <summary>
  700. /// Return material.
  701. /// Or
  702. /// Set material.
  703. /// </summary>
  704. public Material Material {
  705. get {
  706. return GetMaterial ();
  707. }
  708. set {
  709. SetMaterial (value);
  710. }
  711. }
  712. /// <summary>
  713. /// Return text.
  714. /// Or
  715. /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
  716. /// </summary>
  717. public string Text {
  718. get {
  719. return GetText ();
  720. }
  721. set {
  722. SetText (value);
  723. }
  724. }
  725. /// <summary>
  726. /// Return horizontal alignment.
  727. /// Or
  728. /// Set horizontal alignment.
  729. /// </summary>
  730. public HorizontalAlignment HorizontalAlignment {
  731. get {
  732. return GetHorizontalAlignment ();
  733. }
  734. set {
  735. SetHorizontalAlignment (value);
  736. }
  737. }
  738. /// <summary>
  739. /// Return vertical alignment.
  740. /// Or
  741. /// Set vertical alignment.
  742. /// </summary>
  743. public VerticalAlignment VerticalAlignment {
  744. get {
  745. return GetVerticalAlignment ();
  746. }
  747. set {
  748. SetVerticalAlignment (value);
  749. }
  750. }
  751. /// <summary>
  752. /// Return row alignment.
  753. /// Or
  754. /// Set row alignment.
  755. /// </summary>
  756. public HorizontalAlignment TextAlignment {
  757. get {
  758. return GetTextAlignment ();
  759. }
  760. set {
  761. SetTextAlignment (value);
  762. }
  763. }
  764. /// <summary>
  765. /// Return row spacing.
  766. /// Or
  767. /// Set row spacing, 1.0 for original font spacing.
  768. /// </summary>
  769. public float RowSpacing {
  770. get {
  771. return GetRowSpacing ();
  772. }
  773. set {
  774. SetRowSpacing (value);
  775. }
  776. }
  777. /// <summary>
  778. /// Return wordwrap mode.
  779. /// Or
  780. /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
  781. /// </summary>
  782. public bool Wordwrap {
  783. get {
  784. return GetWordwrap ();
  785. }
  786. set {
  787. SetWordwrap (value);
  788. }
  789. }
  790. /// <summary>
  791. /// Return text effect.
  792. /// Or
  793. /// Set text effect.
  794. /// </summary>
  795. public TextEffect TextEffect {
  796. get {
  797. return GetTextEffect ();
  798. }
  799. set {
  800. SetTextEffect (value);
  801. }
  802. }
  803. /// <summary>
  804. /// Return effect shadow offset.
  805. /// Or
  806. /// Set shadow offset.
  807. /// </summary>
  808. public Urho.IntVector2 EffectShadowOffset {
  809. get {
  810. return GetEffectShadowOffset ();
  811. }
  812. set {
  813. SetEffectShadowOffset (value);
  814. }
  815. }
  816. /// <summary>
  817. /// Return effect stroke thickness.
  818. /// Or
  819. /// Set stroke thickness.
  820. /// </summary>
  821. public int EffectStrokeThickness {
  822. get {
  823. return GetEffectStrokeThickness ();
  824. }
  825. set {
  826. SetEffectStrokeThickness (value);
  827. }
  828. }
  829. /// <summary>
  830. /// Return effect round stroke.
  831. /// Or
  832. /// Set stroke rounding. Corners of the font will be rounded off in the stroke so the stroke won't have corners.
  833. /// </summary>
  834. public bool EffectRoundStroke {
  835. get {
  836. return GetEffectRoundStroke ();
  837. }
  838. set {
  839. SetEffectRoundStroke (value);
  840. }
  841. }
  842. /// <summary>
  843. /// Return effect color.
  844. /// Or
  845. /// Set effect color.
  846. /// </summary>
  847. public Urho.Color EffectColor {
  848. get {
  849. return GetEffectColor ();
  850. }
  851. set {
  852. SetEffectColor (value);
  853. }
  854. }
  855. /// <summary>
  856. /// Return effect depth bias.
  857. /// Or
  858. /// Set effect Z bias.
  859. /// </summary>
  860. public float EffectDepthBias {
  861. get {
  862. return GetEffectDepthBias ();
  863. }
  864. set {
  865. SetEffectDepthBias (value);
  866. }
  867. }
  868. /// <summary>
  869. /// Return text width.
  870. /// Or
  871. /// Set text width. Only has effect in word wrap mode.
  872. /// </summary>
  873. public int Width {
  874. get {
  875. return GetWidth ();
  876. }
  877. set {
  878. SetWidth (value);
  879. }
  880. }
  881. /// <summary>
  882. /// Return opacity.
  883. /// Or
  884. /// Set opacity.
  885. /// </summary>
  886. public float Opacity {
  887. get {
  888. return GetOpacity ();
  889. }
  890. set {
  891. SetOpacity (value);
  892. }
  893. }
  894. /// <summary>
  895. /// Return whether text has fixed screen size.
  896. /// Or
  897. /// Set whether text has fixed size on screen (pixel-perfect) regardless of distance to camera. Works best when combined with face camera rotation. Default false.
  898. /// </summary>
  899. public bool FixedScreenSize {
  900. get {
  901. return IsFixedScreenSize ();
  902. }
  903. set {
  904. SetFixedScreenSize (value);
  905. }
  906. }
  907. /// <summary>
  908. /// Return how the text rotates in relation to the camera.
  909. /// Or
  910. /// Set how the text should rotate in relation to the camera. Default is to not rotate (FC_NONE.)
  911. /// </summary>
  912. public FaceCameraMode FaceCameraMode {
  913. get {
  914. return GetFaceCameraMode ();
  915. }
  916. set {
  917. SetFaceCameraMode (value);
  918. }
  919. }
  920. /// <summary>
  921. /// Return font.
  922. /// </summary>
  923. public Font Font {
  924. get {
  925. return GetFont ();
  926. }
  927. }
  928. /// <summary>
  929. /// Return text height.
  930. /// </summary>
  931. public int Height {
  932. get {
  933. return GetHeight ();
  934. }
  935. }
  936. /// <summary>
  937. /// Return row height.
  938. /// </summary>
  939. public int RowHeight {
  940. get {
  941. return GetRowHeight ();
  942. }
  943. }
  944. /// <summary>
  945. /// Return number of rows.
  946. /// </summary>
  947. public uint NumRows {
  948. get {
  949. return GetNumRows ();
  950. }
  951. }
  952. /// <summary>
  953. /// Return number of characters.
  954. /// </summary>
  955. public uint NumChars {
  956. get {
  957. return GetNumChars ();
  958. }
  959. }
  960. /// <summary>
  961. /// Return font attribute.
  962. /// </summary>
  963. public ResourceRef FontAttr {
  964. get {
  965. return GetFontAttr ();
  966. }
  967. }
  968. /// <summary>
  969. /// Return material attribute.
  970. /// </summary>
  971. public ResourceRef MaterialAttr {
  972. get {
  973. return GetMaterialAttr ();
  974. }
  975. }
  976. /// <summary>
  977. /// Return text attribute.
  978. /// </summary>
  979. public string TextAttr {
  980. get {
  981. return GetTextAttr ();
  982. }
  983. }
  984. /// <summary>
  985. /// Get color attribute. Uses just the top-left color.
  986. /// </summary>
  987. public Urho.Color ColorAttr {
  988. get {
  989. return GetColorAttr ();
  990. }
  991. }
  992. }
  993. }