一個 100% Rust GUI 庫:Conrod

jopen 10年前發布 | 125K 次閱讀 Conrod GUI開發框架

Conrod 是一個超級年青,"immediate-mode",完全采用Rust編寫,擁有花哨搜索功能的用戶圖形界面GUI。

可用的組件

  • Buttons
  • Toggles
  • Envelope Editor
  • Number Dialers
  • Sliders
  • TextBox
  • XYPad
  • </ul>

    依賴

    • rustc - we try to keep up to date with the latest nightly build.
    • cargo - for handling other rust dependencies and building the project.
    • freetype - at the moment, Conrod uses freetype-rs for its font rendering, which means you'll need to have the freetype library installed on your system. You can download and install the freetype library here.
    • </ul>

      一個 100% Rust GUI 庫:Conrod

      // Inside our render loop...
      
      button::draw(&render_args, // Screen width and height.
                   &mut gl, // The OpenGL instance used to draw the GUI.
                   &mut ui_context, // A user interface context keeps track of state.
                   unique_id, // Each widget needs it's own UI_ID.
                   Point::new(x, y), // Screen location.
                   width, // Rectangle width f64.
                   height, // Rectangle height f64.
                   Frame(frame_width, frame_color), // Or perhaps `NoFrame` if you don't want one.
                   Color::new(r, g, b, a), // The color of the rectangle.
                   Label("PRESS", font_size, font_color), // Here you can pass Label(...) or NoLabel.
                   || {
          // Callback closure - Do your things here!
      });

      項目主頁:http://www.baiduhome.net/lib/view/home/1409476096463

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!