Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Błąd podczas użycia getContext.
kenobi13
post
Post #1





Grupa: Zarejestrowani
Postów: 32
Pomógł: 0
Dołączył: 13.07.2009
Skąd: Ziemia

Ostrzeżenie: (0%)
-----


Witam. Mak taki oto kod:
Kod
function CharacterRenderer(target, graphics)
{
/*...*/
    this.buffs    = new Array(9);
    this.buffctxs = new Array(9);
    for (var i = 0; i < 9; i++)
    {
        this.buffs[i]    = document.createElement(this.canvas.id + "buff" + i);
        this.buffctxs[i] = this.buffs[i].getContext('2d');
    }
}

Podczas wykonywania wywala mi taki błąd:
Cytat
this.buffs[i].getContext is not a function

Co robię źle?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Kod
document.createElement(this.canvas.id + "buff" + i)

document.createElement tworzy element o podanej nazwie tagu. A "buff" nie występuje w slowie "canvas"
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.09.2025 - 12:24