示例#1
0
        /*-------------------------------------------------------------------------
         * 言語用スポット表示
         * ---------------------------------------------------------------------------*/
        private void draw_spot_for_lang(Vector2 offset)
        {
            m_device.device.RenderState.ZBufferFunction  = Compare.Less;
            m_device.device.RenderState.SourceBlend      = Blend.SourceAlpha;
            m_device.device.RenderState.DestinationBlend = Blend.One;

            float size = m_loop_image.ImageScale;

            if (size < 0.5)
            {
                size = 0.5f;
            }
//			else if(ImageSize > 2)	ImageSize	= 2;
            else if (size > 1)
            {
                size = 1;
            }

            int color = Color.FromArgb(100, 255, 255, 255).ToArgb();

            m_device.sprites.BeginDrawSprites(m_icons.texture, offset, m_loop_image.ImageScale, new Vector2(size, size));
            foreach (GvoWorldInfo.Info i in m_spots)
            {
                icons.icon_index index = icons.icon_index.spot_2;
                if (i.LearnPerson(m_find_string) != null)
                {
                    // 覚えられるところ
                    index = icons.icon_index.spot_0;
                }

                m_device.sprites.AddDrawSprites(new Vector3(i.position.X, i.position.Y, 0.3f),
                                                m_icons.GetIcon(index), color);
            }
            m_device.sprites.EndDrawSprites();

            m_device.device.RenderState.ZBufferFunction  = Compare.LessEqual;
            m_device.device.RenderState.SourceBlend      = Blend.SourceAlpha;
            m_device.device.RenderState.DestinationBlend = Blend.InvSourceAlpha;
        }
示例#2
0
        /*-------------------------------------------------------------------------
         * 描画
         * ---------------------------------------------------------------------------*/
        private void draw_proc(Vector2 offset, LoopXImage image)
        {
            List <ShareShipListBB> list = ShareListBB;

            D3dBB2d.CullingRect rect = new D3dBB2d.CullingRect(image.Device.client_size);
            foreach (ShareShipListBB bb in list)
            {
                // バウンディングボックスで画面外かどうか調べる
                if (bb.IsCulling(offset, image.ImageScale, rect))
                {
                    continue;
                }

#if DRAW_POPUPS_BOUNDINGBOX
                d3d_bb2d.Draw(bb.bb, image.device, 0.5f, offset, image.scale, Color.Red.ToArgb());
#endif
                foreach (ShareRoutes.ShareShip s in bb.List)
                {
                    if (s.Position.X < 0)
                    {
                        continue;
                    }
                    if (s.Position.Y < 0)
                    {
                        continue;
                    }

                    // 地図座標に変換
                    Vector2 pos0 = transform.game_pos2_map_pos(transform.ToVector2(s.Position), image);
                    Vector2 pos  = image.GlobalPos2LocalPos(pos0, offset);

                    // 船
                    icons.icon_index index = (s.State == State.in_the_sea)? icons.icon_index.myship: icons.icon_index.share_city;
                    m_lib.device.sprites.AddDrawSprites(new Vector3(pos.X, pos.Y, 0.31f), m_lib.icons.GetIcon(index));
                }
            }
        }