(画像は公式サイトより)
UX
僕なりの解釈です。勘違いだったら教えてください。
sassyの日々の記録
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <color android:color="#FFFFFF"> </color></item> <item> <color android:color="#000000"> </color></item> </selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape android:shape="rectangle"> <solid android:color="#FFFFFFc"> </solid></shape> </item> <item> <shape android:shape="rectangle"> <solid android:color="#000000"> </solid></shape> </item> </selector>ちょっとはまりました。
class Hello
method: ->
alert "hello"
"class クラス名"でクラスを宣言できます。メソッド名: (引数) -> メソッド本体と書きます。
var Hello;
Hello = (function() {
function Hello() {}
Hello.prototype.method = function() {
return alert("hello");
};
return Hello;
})();
class Animal
constructor: (@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
Animalとうクラスです。class Snake extends Animal
move: ->
alert "Slithering..."
super 5
class Horse extends Animal
move: ->
alert "Galloping..."
super 45
継承はextendsを使います。