日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

在本教程中,我們將使用 FabricJS 創(chuàng)建一個(gè)帶有等待光標(biāo)移動(dòng)對(duì)象的三角形。 wait 是可用的本機(jī)光標(biāo)樣式之一,也可以在 FabricJS 畫布中使用。 FabricJS 提供了各種類型的光標(biāo),例如默認(rèn)、全滾動(dòng)、十字準(zhǔn)線、列調(diào)整大小、行調(diào)整大小等,它們?cè)谀缓笾赜昧吮緳C(jī)光標(biāo)。

moveCursor 屬性設(shè)置當(dāng)對(duì)象在畫布中移動(dòng)時(shí)光標(biāo)的樣式。

語法

new fabric.Triangle({ moveCursor: String }: Object)

登錄后復(fù)制

參數(shù)

    選項(xiàng)(可選) – 此參數(shù)是一個(gè)對(duì)象 為我們的三角形提供額外的定制。使用此參數(shù),可以更改與 moveCursor 為屬性的對(duì)象相關(guān)的屬性,例如顏色、光標(biāo)、描邊寬度和許多其他屬性。

選項(xiàng)鍵

    moveCursor – 該屬性接受一個(gè)字符串,它允許我們?cè)O(shè)置在畫布上移動(dòng)此三角形對(duì)象時(shí)的默認(rèn)光標(biāo)值。該值決定移動(dòng)畫布對(duì)象時(shí)使用的光標(biāo)類型。

    示例 1

    對(duì)象移動(dòng)時(shí)的默認(rèn)光標(biāo)值在畫布上移動(dòng)

    默認(rèn)情況下,當(dāng)我們?cè)诋嫴贾袊@三角形對(duì)象移動(dòng)時(shí),光標(biāo)類型是移動(dòng)。讓我們看一個(gè)代碼示例來理解這一點(diǎn)。

    <!DOCTYPE html>
    <html>
    <head>
       <!-- Adding the Fabric JS Library-->
       <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/510/fabric.min.js"></script>
    </head>
    <body>
       <h2>Default cursor value when object is moved around the canvas</h2>
       <p>You can move around the triangle to see that the default cursor type is "move"</p>
       <canvas id="canvas"></canvas>
       <script>
          // Initiate a canvas instance
          var canvas = new fabric.Canvas("canvas");
          canvas.setWidth(document.body.scrollWidth);
          canvas.setHeight(250);
    
          // Initiate a triangle object
          var triangle = new fabric.Triangle({
             left: 105,
             top: 75,
             width: 90,
             height: 80,
             fill: "#eedc82",
             stroke: "#bcb88a",
             strokeWidth: 5,
          });
    
          // Add it to the canvas
          canvas.add(triangle);
       </script>
    </body>
    </html>

    登錄后復(fù)制

    示例 2

    將 moveCursor 屬性作為鍵傳遞給值

    在此示例中,我們將 moveCursor 鍵傳遞給三角形類值為“等待”。這將確保當(dāng)我們?cè)诋嫴贾械膶?duì)象周圍移動(dòng)時(shí),光標(biāo)值處于等待狀態(tài)。下面的代碼示例對(duì)此進(jìn)行了說明。

    <!DOCTYPE html>
    <html>
    <head>
       <!-- Adding the Fabric JS Library-->
       <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/510/fabric.min.js"></script>
    </head>
    <body>
       <h2>Passing the moveCursor property as key with a value</h2>
       <p>You can move around the triangle to see that the cursor type is "wait"</p>
       <canvas id="canvas"></canvas>
       <script>
          // Initiate a canvas instance
          var canvas = new fabric.Canvas("canvas");
          canvas.setWidth(document.body.scrollWidth);
          canvas.setHeight(250);
    
          // Initiate a triangle object
          var triangle = new fabric.Triangle({
             left: 105,
             top: 75,
             width: 90,
             height: 80,
             fill: "#eedc82",
             stroke: "#bcb88a",
             strokeWidth: 5,
             moveCursor: "wait",
          });
    
          // Add it to the canvas
          canvas.add(triangle);
       </script>
    </body>
    </html>

    登錄后復(fù)制

    以上就是如何使用 FabricJS 在移動(dòng)對(duì)象上創(chuàng)建帶有等待光標(biāo)的三角形?的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!

分享到:
標(biāo)簽:如何使用 對(duì)象 帶有 標(biāo)的 角形
用戶無頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績?cè)u(píng)定