Comment.hx 857 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package hrt.shgraph.nodes;
  2. using hxsl.Ast;
  3. #if editor
  4. import hide.view.GraphInterface;
  5. #end
  6. @name("Comment")
  7. @description("A box that allows you to comment your graph")
  8. @group("Comment")
  9. class Comment extends ShaderNode {
  10. @prop() public var comment : String = "Comment";
  11. @prop() public var width : Float = 200;
  12. @prop() public var height : Float = 200;
  13. override function generate(ctx: NodeGenContext) {}
  14. override function canHavePreview():Bool {
  15. return false;
  16. }
  17. public function new() {
  18. }
  19. #if editor
  20. override function getInfo() : GraphNodeInfo {
  21. var info = super.getInfo();
  22. info.comment = {
  23. getComment: () -> comment,
  24. setComment: (v:String) -> comment = v,
  25. getSize: (p: h2d.col.Point) -> p.set(width, height),
  26. setSize: (p: h2d.col.Point) -> {width = p.x; height = p.y;},
  27. };
  28. info.preview = null;
  29. return info;
  30. }
  31. #end
  32. }