Comment.hx 810 B

12345678910111213141516171819202122232425262728293031323334
  1. package hrt.texgraph.nodes;
  2. #if editor
  3. import hide.view.GraphInterface;
  4. #end
  5. @name("Comment")
  6. @description("A box that allows you to comment your graph")
  7. @group("Comment")
  8. class Comment extends TexNode {
  9. @prop() public var comment : String = "Comment";
  10. @prop() public var width : Float = 200;
  11. @prop() public var height : Float = 200;
  12. public function new () {}
  13. override function apply(vars : Dynamic) : Array<h3d.mat.Texture> {
  14. return null;
  15. }
  16. #if editor
  17. override function getInfo() : GraphNodeInfo {
  18. var info = super.getInfo();
  19. info.comment = {
  20. getComment: () -> comment,
  21. setComment: (v:String) -> comment = v,
  22. getSize: (p: h2d.col.Point) -> p.set(width, height),
  23. setSize: (p: h2d.col.Point) -> { width = p.x; height = p.y; },
  24. };
  25. info.preview = null;
  26. return info;
  27. }
  28. #end
  29. }