User Tools

Site Tools


drawing_with_script

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
drawing_with_script [2014/07/12 15:37]
pierrox Sme hints on drawing with script
drawing_with_script [2014/07/21 07:21] (current)
pierrox syntax highlighting
Line 19: Line 19:
  
 ===== Copy an icon from an item to another item ===== ===== Copy an icon from an item to another item =====
-<code>+<sxh javascript;>
 var i = LL.getCurrentDesktop().getItemByLabel("​some item"​).getDefaultIcon();​ var i = LL.getCurrentDesktop().getItemByLabel("​some item"​).getDefaultIcon();​
 LL.getEvent().getItem().setDefaultIcon(i);​ LL.getEvent().getItem().setDefaultIcon(i);​
-</code>+</sxh>
  
 ===== Paint a diagonal line over a coloured background ===== ===== Paint a diagonal line over a coloured background =====
-<code>+<sxh javascript;>
 // retrieve the image for the clicked item // retrieve the image for the clicked item
 var i = LL.getEvent().getItem().getImage();​ var i = LL.getEvent().getItem().getImage();​
Line 44: Line 44:
 // update so that changes are flipped to the screen // update so that changes are flipped to the screen
 i.update(); i.update();
-</code>+</sxh>
  
 ===== Draw the folder window background with a gradient ===== ===== Draw the folder window background with a gradient =====
-<code>+<sxh javascript;>
 var WIDTH = 512; var WIDTH = 512;
 var HEIGHT = 512; var HEIGHT = 512;
Line 61: Line 61:
 c.drawRect(0,​0,​WIDTH,​HEIGHT,​p);​ c.drawRect(0,​0,​WIDTH,​HEIGHT,​p);​
 i.update(); i.update();
-</code>+</sxh>
drawing_with_script.1405179467.txt.gz · Last modified: 2014/07/12 15:37 by pierrox