Changeset 18 for trunk/lingosource/castlib3/ButtonImageCreator.ls
- Timestamp:
- 10/24/08 12:12:09 (4 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib3/ButtonImageCreator.ls (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib3/ButtonImageCreator.ls
r15 r18 3 3 -- xxxxxxxxxxxxxxxxxx global handlers to create images for widgets 4 4 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 5 -- Alex da Franca ©2003 da.franca@online.de5 -- Alex da Franca c2003 da.franca@online.de 6 6 7 7 … … 38 38 --------------------------------- 39 39 -- Scriptmarker: changes alex (24.07.2006 at 09:32 Uhr) // Scriptmarker 40 40 41 41 42 -- added support for a proplist as #buttonIcon, so that different icons for the different button states can be used … … 99 100 templateTextMember.text = "MM" 100 101 th = templateTextMember.charPosToLoc(2) 101 textimg = image( th[1],th[2],8,0,#grayscale)102 textimg = image(max(1, th[1]),max(1, th[2]),8,0,#grayscale) 102 103 end if 103 104 … … 258 259 end if 259 260 260 buttonIconW = hoehe - marginV*2 261 buttonIconW = min(breite, hoehe) - marginV*2 262 buttonIconW = min(16, buttonIconW) 261 263 buttonIcon = image(buttonIconW, buttonIconW, 32, 1) 262 264 … … 279 281 if noText = 1 then breite = max(marginH, myRect.width) 280 282 281 dasRect = rect(0, 0, breite + buttonIconW, hoehe + buttonIconH) 283 if noText <> 1 then 284 dasRect = rect(0, 0, breite + buttonIconW, hoehe + buttonIconH) 285 else 286 dasRect = rect(0, 0, breite, hoehe) 287 end if 282 288 283 289 -- offset: … … 343 349 end if 344 350 351 alteMaske = 0 345 352 if img.depth = 32 then alteMaske = img.extractAlpha() 346 353 … … 388 395 else buffsH = textbreite - buttonIconW + shadowOffs[1] 389 396 390 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 397 buffsV = (dasRect.height - buttonIcon.height) / 2 + shadowOffs[2] 398 399 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 391 400 end if 392 401 … … 401 410 else buffsH = textbreite - buttonIconW + shadowOffs[1] 402 411 403 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 412 buffsV = (dasRect.height - buttonIcon.height) / 2 + shadowOffs[2] 413 414 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 404 415 end if 405 416 … … 409 420 410 421 if noText = 1 then 411 if buttonIconAlign = #right then buffsH = dasRect.width - buttonIconW + shadowOffs[1] 412 else buffsH = marginH + shadowOffs[1] 413 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 422 -- if buttonIconAlign = #right then buffsH = dasRect.width - buttonIconW + shadowOffs[1] 423 -- else buffsH = marginH + shadowOffs[1] 424 ----------- just align center 425 426 buffsH = (dasRect.width - buttonIcon.width) / 2 + shadowOffs[1] 427 buffsV = (dasRect.height - buttonIcon.height) / 2 + shadowOffs[2] 428 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 429 414 430 else 415 431 if buttonIconAlign = #right then buffsH = dasRect.width - buttonIconW + shadowOffs[1] … … 488 504 end if 489 505 506 alteMaske = 0 490 507 if img.depth = 32 then alteMaske = img.extractAlpha() 491 508 … … 563 580 if noText = 1 then 564 581 565 if buttonIconAlign = #right then buffsH = dasRect.width - buttonIconW + shadowOffs[1] 566 else buffsH = marginH + shadowOffs[1] 567 568 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 582 -- if buttonIconAlign = #right then buffsH = dasRect.width - buttonIconW + shadowOffs[1] 583 -- else buffsH = marginH + shadowOffs[1] 584 ----------- just align center 585 586 buffsH = (dasRect.width - buttonIcon.width) / 2 + shadowOffs[1] 587 buffsV = (dasRect.height - buttonIcon.height) / 2 + shadowOffs[2] 588 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 589 590 591 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 569 592 else 570 593 … … 572 595 else buffsH = textbreite - buttonIconW + shadowOffs[1] 573 596 574 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 597 buffsV = (dasRect.height - buttonIcon.height) / 2 + shadowOffs[2] 598 599 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 575 600 end if 576 601 end if … … 639 664 end if 640 665 666 alteMaske = 0 641 667 if img.depth = 32 then alteMaske = img.extractAlpha() 642 668 … … 686 712 -- else buffsH = marginH + shadowOffs[1] 687 713 688 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 714 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 715 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 689 716 else 690 717 … … 692 719 -- else buffsH = textbreite - buttonIconW + shadowOffs[1] 693 720 694 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect)721 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 695 722 end if 696 723 end if … … 760 787 end if 761 788 789 alteMaske = 0 762 790 if img.depth = 32 then alteMaske = img.extractAlpha() 763 791 … … 807 835 if noText = 1 then 808 836 809 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(marginH + shadowOffs[1], marginV + shadowOffs[2]), buttonIcon.rect) 810 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 837 -- -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(marginH + shadowOffs[1], marginV + shadowOffs[2]), buttonIcon.rect) 838 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 839 840 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 811 841 812 842 else 813 843 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(textbreite - buttonIconW + shadowOffs[1], marginV + shadowOffs[2]), buttonIcon.rect) 814 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect)844 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 815 845 end if 816 846 end if … … 886 916 end if 887 917 918 alteMaske = 0 888 919 if img.depth = 32 then alteMaske = img.extractAlpha() 889 920 … … 921 952 if noText = 1 then 922 953 923 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 954 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 955 -- img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect) 924 956 else 925 957 926 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, marginV + shadowOffs[2]), buttonIcon.rect)958 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 927 959 end if 928 960 end if … … 1211 1243 1212 1244 -- -- museum hack fuer zweifarbige rahmen: 1213 if call(#mGetThisMovieName, mGetXScript( #commonMovieScript)) = "Kindermuseum" then trect = trect.inflate(-1, -1) -- weisser 1-pixel rahmen1245 if call(#mGetThisMovieName, mGetXScript()) = "Kindermuseum" then trect = trect.inflate(-1, -1) -- weisser 1-pixel rahmen 1214 1246 1215 1247 tempImg.fill(trect, rahmenfarbe) … … 1396 1428 1397 1429 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1430 1398 1431 on mCreateDropDownTriangle me, rHeight 1399 1432 … … 1431 1464 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1432 1465 1466 on mCreateCheckBoxButton me, theLabel, options, retlist 1467 1468 if ilk(options) <> #proplist then options = [:] 1469 1470 textimg = theLabel 1471 1472 cms = mGetXScript() 1473 ius = mGetXScript(#imageUtilityScripts) 1474 1475 if ilk(textimg) <> #image then 1476 theString = call(#mTranslate, cms, string(textimg)) 1477 if theString.length then 1478 maxW = options.getaprop(#maxWidth) 1479 if ilk(maxW) <> #integer then maxW = 500 1480 textimg = call(#mGetTextImage, ius, theString, options, maxW, member("buttontexttempl"), options.getaprop(#dontwrap)) 1481 1482 else 1483 -- no text and no image ?! just return 1484 if ilk(retlist) <> #proplist then return [:] 1485 return retlist 1486 1487 end if 1488 end if 1489 1490 myRect = options.getaprop(#myRect) 1491 if ilk(myRect) <> #rect then myRect = rect(0,0,2,2) 1492 1493 texthoehe = textimg.height 1494 textbreite = textimg.width 1495 1496 marginH = options.getaprop(#marginH) 1497 marginV = options.getaprop(#marginV) 1498 1499 hoehe = max((texthoehe + (marginV * 2)), myRect.height) 1500 breite = max((textbreite + (marginH * 2)), myRect.width) 1501 1502 1503 if (textimg.depth = 1) or ((textimg.depth = 8) and (textimg.paletteref = #grayscale)) then 1504 temp = image(textbreite, texthoehe, 32) 1505 fontfarbe = options.getaprop(#myFontcolor) 1506 if ilk(fontfarbe) <> #color then 1507 fontfarbe = rgb(0,0,0) 1508 options[#myFontcolor] = fontfarbe 1509 end if 1510 temp.fill(temp.rect, fontfarbe) 1511 1512 temp2 = textimg 1513 1514 else 1515 temp = textimg 1516 1517 if temp.depth = 32 then 1518 temp.useAlpha = 0 1519 temp2 = temp.extractAlpha() 1520 else 1521 temp2 = image(temp.width, temp.height, 8, 0, #grayscale) 1522 temp2.fill(temp2.rect, rgb(0,0,0)) 1523 end if 1524 1525 end if 1526 1527 1528 1529 buttonIconType = options.getaprop(#buttonIcon) 1530 1531 1532 buttonIconList = [:] 1533 1534 hlfarbe = options.getaprop(#pressedColor) 1535 if ilk(hlfarbe) <> #color then hlfarbe = options.getaprop(#selectedColor) 1536 if ilk(hlfarbe) <> #color then hlfarbe = options.getaprop(#myFontColor) 1537 1538 if ilk(buttonIconType) = #image then 1539 buttonIcon = buttonIconType 1540 buttonIconW = buttonIcon.width + marginH 1541 buttonIconH = max(0, (buttonIcon.height + marginV*2) - hoehe) 1542 1543 buttonIconList.setaprop(#normal, buttonIcon) 1544 1545 else if ilk(buttonIconType) = #proplist then 1546 buttonIcon = buttonIconType.getaprop(#normal) 1547 if ilk(buttonIcon) = #image then 1548 buttonIconList = buttonIconType 1549 buttonIconW = buttonIcon.width + marginH 1550 buttonIconH = max(0, (buttonIcon.height + marginV*2) - hoehe) 1551 else 1552 buttonIconW = 0 1553 buttonIconH = 0 1554 end if 1555 1556 else 1557 case buttonIconType of 1558 #checkbox: 1559 1560 if ilk(fontfarbe) <> #color then 1561 fontfarbe = options.getaprop(#myFontcolor) 1562 if ilk(fontfarbe) <> #color then 1563 fontfarbe = rgb(0,0,0) 1564 options[#myFontcolor] = fontfarbe 1565 end if 1566 end if 1567 1568 buttonIconW = hoehe - marginV*2 1569 buttonIcon = image(buttonIconW, buttonIconW, 32, 1) 1570 buttonIcon.fill(buttonIcon.rect, fontfarbe) 1571 buttonIconM = image(buttonIconW, buttonIconW, 8, 0, #grayscale) 1572 buttonIconM.draw(buttonIconM.rect, [#linesize:1, #shapetype:#rect, #color:rgb(0,0,0)]) 1573 buttonIcon.setAlpha(buttonIconM) 1574 1575 buttonIconW = buttonIconW + marginH 1576 buttonIconH = 0 1577 1578 buttonIconList.setaprop(#normal, buttonIcon.duplicate()) 1579 1580 1581 1582 if ilk(hlfarbe) = #color then buttonIcon.fill(buttonIcon.rect, hlfarbe) 1583 buttonIconM.draw(point(0, 0), point(buttonIconM.width, buttonIconM.height), [#linesize:1, #shapetype:#line, #color:rgb(0,0,0)]) 1584 buttonIconM.draw(point(0, buttonIconM.height), point(buttonIconM.width, 0), [#linesize:1, #shapetype:#line, #color:rgb(0,0,0)]) 1585 buttonIcon.setAlpha(buttonIconM) 1586 1587 buttonIconList.setaprop(#pressed, buttonIcon) 1588 1589 #radiobutton: 1590 1591 if ilk(fontfarbe) <> #color then 1592 fontfarbe = options.getaprop(#myFontcolor) 1593 if ilk(fontfarbe) <> #color then 1594 fontfarbe = rgb(0,0,0) 1595 options[#myFontcolor] = fontfarbe 1596 end if 1597 end if 1598 1599 buttonIconW = hoehe - marginV*2 1600 buttonIcon = image(buttonIconW, buttonIconW, 32, 1) 1601 buttonIcon.fill(buttonIcon.rect, fontfarbe) 1602 buttonIconM = image(buttonIconW, buttonIconW, 8, 0, #grayscale) 1603 buttonIconM.draw(buttonIconM.rect, [#linesize:1, #shapetype:#oval, #color:rgb(0,0,0)]) 1604 buttonIcon.setAlpha(buttonIconM) 1605 1606 buttonIconW = buttonIconW + marginH 1607 buttonIconH = 0 1608 1609 buttonIconList.setaprop(#normal, buttonIcon.duplicate()) 1610 1611 if ilk(hlfarbe) = #color then buttonIcon.fill(buttonIcon.rect, hlfarbe) 1612 buttonIconM.fill(buttonIconM.rect.inflate(-3, -3), [#shapetype:#oval, #color:rgb(0,0,0)]) 1613 buttonIcon.setAlpha(buttonIconM) 1614 1615 buttonIconList.setaprop(#pressed, buttonIcon) 1616 1617 #dropdown: 1618 1619 if ilk(fontfarbe) <> #color then 1620 fontfarbe = options.getaprop(#myFontcolor) 1621 if ilk(fontfarbe) <> #color then 1622 fontfarbe = rgb(0,0,0) 1623 options[#myFontcolor] = fontfarbe 1624 end if 1625 end if 1626 1627 buttonIconW = min(breite, hoehe) - marginV*2 1628 buttonIconW = min(16, buttonIconW) 1629 buttonIcon = image(buttonIconW, buttonIconW, 32, 1) 1630 1631 buttonIcon.fill(buttonIcon.rect, fontfarbe) 1632 1633 buttonIconM = mCreateDropDownTriangle(me, buttonIconW) 1634 buttonIcon.setAlpha(buttonIconM) 1635 1636 buttonIconW = buttonIconW + marginH 1637 buttonIconH = 0 1638 1639 buttonIconList.setaprop(#normal, buttonIcon) 1640 1641 otherwise 1642 buttonIconW = 0 1643 buttonIconH = 0 1644 buttonIcon = 0 1645 1646 buttonIconList = [:] 1647 1648 end case 1649 end if 1650 1651 dasRect = rect(0, 0, breite + buttonIconW, hoehe + buttonIconH) 1652 1653 texthoehe = (dasRect.height - texthoehe) / 2 1654 textbreite = marginH + buttonIconW 1655 1656 ----------------------------- 1657 textoffset = options.getaprop(#textoffset) 1658 if ilk(textoffset) = #point then 1659 textbreite = textbreite + textoffset[1] 1660 texthoehe = texthoehe + textoffset[2] 1661 end if 1662 ----------------------------- 1663 1664 if ilk(retlist) <> #proplist then 1665 retlist = [:] 1666 retlist[#normal] = 1 1667 retlist[#pressed] = 1 1668 retlist[#hilite] = 1 1669 retlist[#disabled] = 1 1670 retlist[#selected] = 1 1671 end if 1672 1673 1674 1675 buffsH = textbreite - buttonIconW 1676 if ilk(buttonIcon) = #image then 1677 buffsV = (dasRect.height - buttonIcon.height) / 2 1678 else 1679 buffsV = 0 1680 end if 1681 1682 img = image(dasrect.width, dasrect.height, 32, 1) 1683 aImg = image(img.width, img.height, 8, 0, #grayscale) 1684 img.useAlpha = 0 1685 1686 img.copyPixels(temp, temp.rect.offset(textbreite, texthoehe), temp.rect) 1687 aImg.copyPixels(temp2, temp2.rect.offset(textbreite, texthoehe), temp2.rect) 1688 1689 buttonIcon = buttonIconList.getaprop(#normal) 1690 if ilk(buttonIcon) = #image then 1691 if buttonIcon.depth = 32 then 1692 buttonIcon.useAlpha = 0 1693 buttonIconA = buttonIcon.extractAlpha() 1694 else 1695 buttonIconA = image(buttonIcon.width, buttonIconA.height, 8, 0, #grayscale) 1696 buttonIconA.fill(buttonIconA.rect, rgb(0,0,0)) 1697 end if 1698 1699 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1700 aImg.copyPixels(buttonIconA, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1701 end if 1702 1703 img.setAlpha(aImg) 1704 img.useAlpha = 1 1705 1706 retlist[#normal] = img 1707 1708 ------------------------------- 1709 1710 if not(voidP(retlist.getaprop(#pressed))) then 1711 1712 hlfarbe = options.getaprop(#pressedColor) 1713 if ilk(hlfarbe) = #color then temp.fill(temp.rect, hlfarbe) 1714 1715 img = image(dasrect.width, dasrect.height, 32, 1) 1716 aImg = image(img.width, img.height, 8, 0, #grayscale) 1717 img.useAlpha = 0 1718 1719 img.copyPixels(temp, temp.rect.offset(textbreite, texthoehe), temp.rect) 1720 aImg.copyPixels(temp2, temp2.rect.offset(textbreite, texthoehe), temp2.rect) 1721 1722 buttonIcon = buttonIconList.getaprop(#pressed) 1723 if ilk(buttonIcon) <> #image then buttonIcon = buttonIconList.getaprop(#normal) 1724 if ilk(buttonIcon) = #image then 1725 if buttonIcon.depth = 32 then 1726 buttonIcon.useAlpha = 0 1727 buttonIconA = buttonIcon.extractAlpha() 1728 else 1729 buttonIconA = image(buttonIcon.width, buttonIconA.height, 8, 0, #grayscale) 1730 buttonIconA.fill(buttonIconA.rect, rgb(0,0,0)) 1731 end if 1732 1733 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1734 aImg.copyPixels(buttonIconA, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1735 end if 1736 1737 img.setAlpha(aImg) 1738 img.useAlpha = 1 1739 1740 retlist[#pressed] = img 1741 1742 end if 1743 1744 1745 ------------------------------- 1746 1747 if not(voidP(retlist.getaprop(#hilite))) then 1748 1749 hlfarbe = options.getaprop(#hiliteColor) 1750 if ilk(hlfarbe) = #color then temp.fill(temp.rect, hlfarbe) 1751 1752 img = image(dasrect.width, dasrect.height, 32, 1) 1753 aImg = image(img.width, img.height, 8, 0, #grayscale) 1754 img.useAlpha = 0 1755 1756 img.copyPixels(temp, temp.rect.offset(textbreite, texthoehe), temp.rect) 1757 aImg.copyPixels(temp2, temp2.rect.offset(textbreite, texthoehe), temp2.rect) 1758 1759 buttonIcon = buttonIconList.getaprop(#hilite) 1760 if ilk(buttonIcon) <> #image then buttonIcon = buttonIconList.getaprop(#normal) 1761 if ilk(buttonIcon) = #image then 1762 if buttonIcon.depth = 32 then 1763 buttonIcon.useAlpha = 0 1764 buttonIconA = buttonIcon.extractAlpha() 1765 else 1766 buttonIconA = image(buttonIcon.width, buttonIconA.height, 8, 0, #grayscale) 1767 buttonIconA.fill(buttonIconA.rect, rgb(0,0,0)) 1768 end if 1769 1770 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1771 aImg.copyPixels(buttonIconA, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1772 end if 1773 1774 img.setAlpha(aImg) 1775 img.useAlpha = 1 1776 1777 retlist[#hilite] = img 1778 1779 end if 1780 1781 1782 1783 ------------------------------- 1784 1785 if not(voidP(retlist.getaprop(#disabled))) then 1786 1787 hlfarbe = options.getaprop(#disabledColor) 1788 if ilk(hlfarbe) = #color then temp.fill(temp.rect, hlfarbe) 1789 1790 img = image(dasrect.width, dasrect.height, 32, 1) 1791 aImg = image(img.width, img.height, 8, 0, #grayscale) 1792 img.useAlpha = 0 1793 1794 img.copyPixels(temp, temp.rect.offset(textbreite, texthoehe), temp.rect) 1795 aImg.copyPixels(temp2, temp2.rect.offset(textbreite, texthoehe), temp2.rect) 1796 1797 buttonIcon = buttonIconList.getaprop(#disabled) 1798 if ilk(buttonIcon) <> #image then buttonIcon = buttonIconList.getaprop(#normal) 1799 if ilk(buttonIcon) = #image then 1800 if buttonIcon.depth = 32 then 1801 buttonIcon.useAlpha = 0 1802 buttonIconA = buttonIcon.extractAlpha() 1803 else 1804 buttonIconA = image(buttonIcon.width, buttonIconA.height, 8, 0, #grayscale) 1805 buttonIconA.fill(buttonIconA.rect, rgb(0,0,0)) 1806 end if 1807 1808 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1809 aImg.copyPixels(buttonIconA, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1810 end if 1811 1812 img.setAlpha(aImg) 1813 img.useAlpha = 1 1814 1815 retlist[#disabled] = img 1816 end if 1817 1818 1819 1820 ------------------------------- 1821 1822 if not(voidP(retlist.getaprop(#selected))) then 1823 1824 hlfarbe = options.getaprop(#selectedColor) 1825 if ilk(hlfarbe) = #color then temp.fill(temp.rect, hlfarbe) 1826 1827 img = image(dasrect.width, dasrect.height, 32, 1) 1828 aImg = image(img.width, img.height, 8, 0, #grayscale) 1829 img.useAlpha = 0 1830 1831 img.copyPixels(temp, temp.rect.offset(textbreite, texthoehe), temp.rect) 1832 aImg.copyPixels(temp2, temp2.rect.offset(textbreite, texthoehe), temp2.rect) 1833 1834 buttonIcon = buttonIconList.getaprop(#selected) 1835 if ilk(buttonIcon) <> #image then buttonIcon = buttonIconList.getaprop(#normal) 1836 if ilk(buttonIcon) = #image then 1837 if buttonIcon.depth = 32 then 1838 buttonIcon.useAlpha = 0 1839 buttonIconA = buttonIcon.extractAlpha() 1840 else 1841 buttonIconA = image(buttonIcon.width, buttonIconA.height, 8, 0, #grayscale) 1842 buttonIconA.fill(buttonIconA.rect, rgb(0,0,0)) 1843 end if 1844 1845 img.copyPixels(buttonIcon, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1846 aImg.copyPixels(buttonIconA, buttonIcon.rect.offset(buffsH, buffsV), buttonIcon.rect) 1847 end if 1848 1849 img.setAlpha(aImg) 1850 img.useAlpha = 1 1851 1852 retlist[#selected] = img 1853 end if 1854 1855 1856 return retlist 1857 end 1858 1859 1860 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1861 1433 1862 on interface me 1434 str = "Button Image Creator Script by alex da franca ©2003 -- alex@farbflash.de -- all rigths reserved"1863 str = "Button Image Creator Script by alex da franca c2003 -- alex@farbflash.de -- all rigths reserved" 1435 1864 1436 1865 put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str
Note: See TracChangeset
for help on using the changeset viewer.
