Exemplo n.º 1
0
	void UILogin::draw(float inter) const
	{
		UIElement::draw(inter);

		account.draw(position);
		password.draw(position);

		using::Graphics::DrawArgument;
		if (account.getstate() == Textfield::NORMAL && account.gettext().size() == 0)
			accountbg.draw(DrawArgument(310, 249));
		if (password.getstate() == Textfield::NORMAL && password.gettext().size() == 0)
			passwordbg.draw(DrawArgument(310, 275));

		checkbox.at(saveid).draw(DrawArgument(position + Point<int16_t>(313, 304)));
	}
Exemplo n.º 2
0
	void Mob::draw(Point<int16_t> viewpos, float alpha) const
	{
		Point<int16_t> absp = phobj.getposition(alpha) + viewpos;
		Point<int16_t> headpos = getheadpos(absp);

		effects.drawbelow(absp, alpha);

		if (!dead)
		{
			float interopc = opacity.get(alpha);

			using Graphics::DrawArgument;
			animations.at(stance).draw(DrawArgument(absp, flip && !noflip, interopc), alpha);

			if (showhp)
			{
				namelabel.draw(absp);

				if (!dying && hppercent > 0)
				{
					hpbar.draw(headpos, hppercent);
				}
			}
		}

		effects.drawabove(absp, alpha);
	}
Exemplo n.º 3
0
	void Icon::dragdraw(Point<int16_t> cursorpos) const
	{
		if (dragged)
		{
			using Graphics::DrawArgument;
			texture.draw(DrawArgument(cursorpos - cursoroffset, 0.5f));
		}
	}
	void Background::draw(Point<int16_t> position, float inter) const
	{
		int16_t shiftx = static_cast<int16_t>(rx * (-position.x() + WOFFSET) / 100 + WOFFSET);
		int16_t shifty = static_cast<int16_t>(ry * (-position.y() + HOFFSET) / 100 + HOFFSET);
		int16_t x = moveobj.getx(inter);
		int16_t y = moveobj.gety(inter);
		
		if (moveobj.hspeed != 0.0)
		{
			x += position.x();
			y += shifty;
		}
		else if (moveobj.vspeed != 0.0)
		{
			x += shiftx;
			y += position.y();
		}
		else
		{
			x += shiftx;
			y += shifty;
		}

		if (htile > 1)
		{
			while (x > 0)
			{
				x -= cx;
			}
			while (x < -cx)
			{
				x += cx;
			}
		}

		if (vtile > 1)
		{
			while (y > 0)
			{
				y -= cy;
			}
			while (y < -cy)
			{
				y += cy;
			}
		}

		int16_t endx = x + cx * htile;
		int16_t endy = y + cy * vtile;
		for (int16_t tx = x; tx < endx; tx += cx)
		{
			for (int16_t ty = y; ty < endy; ty += cy)
			{
				using Graphics::DrawArgument;
				animation.draw(DrawArgument(Point<int16_t>(tx, ty), flipped, opacity / 255), inter);
			}
		}
	}
Exemplo n.º 5
0
	void MesoDrop::draw(const Camera& camera, float inter) const
	{
		if (!active)
			return;

		Point<int16_t> absp = phobj.getposition(inter) + camera.getposition(inter);

		using Graphics::DrawArgument;
		icon->draw(DrawArgument(absp, opacity), inter);
	}
Exemplo n.º 6
0
	void Icon::draw(Point<int16_t> position) const
	{
		using Graphics::DrawArgument;
		texture.draw(DrawArgument(position, dragged ? 0.5f : 1.0f));

		int16_t tempc = dragged ? (count - 1) : count;
		if (tempc >= 0 && showcount)
		{
			static const Charset countset = Charset(nl::nx::ui["Basic.img"]["ItemNo"], Charset::LEFT);
			countset.draw(std::to_string(tempc), position + Point<int16_t>(0, 20));
		}
	}
Exemplo n.º 7
0
	void Mob::showeffect(Animation animation, int8_t pos, int8_t z, bool f)
	{
		if (active)
		{
			Point<int16_t> shift;
			switch (pos)
			{
			case 0:
				break;
			case 1:
				break;
			case 2:
				break;
			case 3:
				break;
			case 4:
				break;
			}
			using Graphics::DrawArgument;
			effects.add(animation, DrawArgument(shift, f), z);
		}
	}